You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Extend the set of support CSS properties in {N} #191
Would Flexbox ever be considered, maybe using Facebook's existing css-layout code? As I understand it, however. The absolutely positioned css wasn't considered because it it'd require NativeScript to implement its own layout engine.
I would really like to have background-image property options supported, especially no-repeat and -x/-y. This is a showstopper for an app I'm working on now.
I don't know if you've a plan set for solving animations. One way to do it would be to transpile the transform and transition properties into something the mobiles understand
Agree with @bundyo that having Border element as xml is strange. It also prohibits different styling for different sides of the border which are necessary eg:
border-top-width,
border-bottom-width
and so on for left and right, and other suffixes style and color.
@valentinstoychev Its widely known/used since its part of the css 3 spec. It will make it easy for developers coming from the web tech to get up and running rather than learn a new layout engine. This by no means assert that the current layout engine is bad. I just think adaptation will be faster and easier for devs coming from js/web tech.
Using this approach, you could just add/remove CSS class to change icons. Absent this support, some JavaScript is required to manually change the "text" property of the button. I'm doing it today with converters, but CSS class would be more elegant/web familiar.
If pseudo elements cannot be supported in NativeScript, maybe this is an edge case that justifies allowing the content property in NativeScript to set an element's "text" property (if available)?
Reacted by Nedim Erkocevic, Zdravko and Kei Oikawa
I know this is an older issue, but I would love to see :hover and button animation features if possible. Being able to use a similar css style like that of Angular4 would make my day!
Hi @michaelsterpka Can you please elaborate more on those features and properties and in what cases you would want to use them. For example - on a mobile device there is rarely a mouse pointer so :hover is hard to achieve.
@vakrilov :hover = :tap in my opinion as when I set the :hover pseudo selector for web apps, it automagically gets converted to a tap trigger when viewing from mobile.
hey @vakrilov i saw on another thread that you were working on ::after and ::before selectors way back ... did those ever make it in? Or is there another workaround you could recommend? I'm trying to add '%' and '$' to two items, but would rather do it on the CSS side so that I can still do math stuff with the numbers
@dhoffens The most direct way to do that kind of formatting in {N} today is to use data binding "expressions" (or "converters" if you're using Angular). Here are some docs on the topic:
Activity
vakrilov commentedon May 20, 2015
Properties related to backgrounds:
background-colorbackground-imagebackground-positionbackground-repeatbackground-sizeAnd some font properties:
font-familyfont-stylefont-weightbundyo commentedon May 20, 2015
These would be nice in no particular order:
Low priority, for bling mostly:
RangerMauve commentedon May 20, 2015
Would Flexbox ever be considered, maybe using Facebook's existing css-layout code? As I understand it, however. The absolutely positioned css wasn't considered because it it'd require NativeScript to implement its own layout engine.
emiloberg commentedon May 20, 2015
Not so much a property as a value: Sizes (width/height) as percentages
jlooper commentedon May 21, 2015
I would really like to have background-image property options supported, especially no-repeat and -x/-y. This is a showstopper for an app I'm working on now.
bundyo commentedon May 21, 2015
Also, when adding support for background-position, please consider the little known right/bottom offset positioning, for instance:
emiloberg commentedon May 21, 2015
font-weightbecause currently the only way of setting font-weight isOr am I missing something?
manijak commentedon May 26, 2015
What about state-selectors? To be able to style pressed or hover effects?
jamlfy commentedon May 26, 2015
@manijak seudo-class
emiloberg commentedon May 26, 2015
I don't know if you've a plan set for solving animations. One way to do it would be to transpile the
transformandtransitionproperties into something the mobiles understandmdgiles commentedon Jun 2, 2015
Agree with @bundyo that having Border element as xml is strange. It also prohibits different styling for different sides of the border which are necessary eg:
border-top-width,
border-bottom-width
and so on for left and right, and other suffixes style and color.
mdgiles commentedon Jun 2, 2015
+1 @emiloberg sizing (widths / heights) as percentages are needed.
nemephx commentedon Jun 6, 2015
I need
font-familyandfont-weightasap :)16 remaining items
emmanuelbuah commentedon Sep 1, 2015
How about flexbox layout as layout engine?
valentinstoychev commentedon Sep 7, 2015
@emmanuelbuah flexbox is definitely possible. Where do you see it adding more value compared with our current layout implentation?
emmanuelbuah commentedon Sep 8, 2015
@valentinstoychev Its widely known/used since its part of the css 3 spec. It will make it easy for developers coming from the web tech to get up and running rather than learn a new layout engine. This by no means assert that the current layout engine is bad. I just think adaptation will be faster and easier for devs coming from js/web tech.
toddanglin commentedon Feb 14, 2016
Is the CSS
contentproperty being evaluated, too?Would be useful as a way to change text/font icons via CSS classes. Example:
.myClass{ content: ''; color: #000; }t1amat9409 commentedon Mar 8, 2016
@toddanglin
Check this link
https://docs.nativescript.org/ui/icon-fonts
bundyo commentedon Mar 8, 2016
The CSS content property is only valid for before/after pseudo elements and I'm not sure of the viability of pseudo-elements in NativeScript.
toddanglin commentedon Mar 8, 2016
@bundyo That makes sense. I hadn't thought about the complexity of supporting the pseudo elements. Worth some extra thinking.
The scenario I was after was the ability to use CSS (only) to change icons in a button. Something like:
Using this approach, you could just add/remove CSS class to change icons. Absent this support, some JavaScript is required to manually change the "text" property of the button. I'm doing it today with converters, but CSS class would be more elegant/web familiar.
If pseudo elements cannot be supported in NativeScript, maybe this is an edge case that justifies allowing the
contentproperty in NativeScript to set an element's "text" property (if available)?mster commentedon Sep 15, 2017
I know this is an older issue, but I would love to see :hover and button animation features if possible. Being able to use a similar css style like that of Angular4 would make my day!
vakrilov commentedon Sep 16, 2017
Hi @michaelsterpka Can you please elaborate more on those features and properties and in what cases you would want to use them. For example - on a mobile device there is rarely a mouse pointer so
:hoveris hard to achieve.xerxicodex commentedon Mar 25, 2018
@vakrilov :hover = :tap in my opinion as when I set the :hover pseudo selector for web apps, it automagically gets converted to a tap trigger when viewing from mobile.
dhoffens commentedon Aug 16, 2018
hey @vakrilov i saw on another thread that you were working on ::after and ::before selectors way back ... did those ever make it in? Or is there another workaround you could recommend? I'm trying to add '%' and '$' to two items, but would rather do it on the CSS side so that I can still do math stuff with the numbers
toddanglin commentedon Aug 16, 2018
@dhoffens The most direct way to do that kind of formatting in {N} today is to use data binding "expressions" (or "converters" if you're using Angular). Here are some docs on the topic:
https://docs.nativescript.org/core-concepts/data-binding#using-expressions-for-bindings
If you're using Angular with {N}, follow this guidance instead:
https://docs.nativescript.org/core-concepts/angular-data-binding#data-converters
In both cases, these techniques let you modify the presentation of model without changing the actual values. Hope this helps.
lock commentedon Aug 26, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.