Comments (9)
Hi @alexmick, @sabeurthabti , I like the syntax as well!
It will allow us to get all the mainContainer styles using styles.mainContainer
and apply them to the child elements of the container. We can then easily do something like: <Text style={mainContainerStyles.headerText}>Header</Text>
headerText
should not have its parent attributes in my opinion. But it will give us the ability to distinguish a mainContainer.headerText
from a footer.headerText
for example.
from react-native-css.
headerText should not have its parent attributes in my opinion. But it will give us the ability to distinguish a mainContainer.headerText from a footer.headerText for example.
OK, we should make sure it's clear though because this might be confusing for people who commonly use scss nesting who could expect some kind of inheritance...
I'll be taking on a new react-native project very soon, I might implement this in the process, unless @Filipvdb321 is interested.
from react-native-css.
Hi @alexmick , this week I am a bit busy but next week I would be happy to work on the new feature.
from react-native-css.
@raz21 I don't think there's a css property for shadow-color
or shadow-offset
. You define them in box-shadow
or text-shadow
. Correct me if I'm wrong. Anyway, it's not related to this ticket.
from react-native-css.
That's an interesting point @Filipvdb321 , personally I've only ever used it without nesting and I don't think it was ever thought through.
What would you suggest as a syntax ? styles.mainContainer.headerText
? Should it have all the attributes of the parent as well in you opinion ?
from react-native-css.
@alexmick i am a fan of styles.mainContainer.headerText
@Filipvdb321 what do you think?
from react-native-css.
Hi Everyone,
I am also facing the same issue after conversion:
My Style.CSS
Wrapper{
background-color:#fff;
border-radius:4;
border-width: 1;
border-color: #e1e8ee;
shadow-color: rgba(0,0,0,.2);
shadow-offset: {height:0, width:0};
shadow-opacity:1;
shadow-radius:1;
elevation:3;
}
Getting converted it like:
"Wrapper":{"backgroundColor":"#fff",
"borderRadius":4,
"borderWidth":1,
"borderColor":"#e1e8ee",
"shadowColor":"rgba(0,0,0,.2)",
"shadowOffset":"{height:0, width:0"},";\t
elevation:3;
shadow-opacity:1;
shadow-radius:1;
\tpadding-bottom:10;
\tmargin:10 15;\t }
Want to add shadowOffset:{height:0, width:0}
How should I add it to css so that i could get it properly in style.js
Pls help me.
Thanks,
Rajesh
from react-native-css.
Hi @raz21,
As you're aware this is an open source project, we would love your contribution on this bug. I am able to help, as much as I can.
from react-native-css.
I needed this in one of my project so I took time and built a simple solution. Let me know what you think.
from react-native-css.
Related Issues (20)
- Can i write LESS like CSS just like that in webpages with this tool? HOT 2
- Doesn't work with Windows OS HOT 1
- value auto is set like null HOT 3
- Can't generate shadowOffset HOT 4
- Shorthands aren't properly expanding HOT 1
- Update purpose and scope HOT 1
- Add validation
- Interest in Integrating? HOT 5
- Convert properties that don't match their CSS equivalent HOT 5
- Compatibility with other css preprocessors - Stylus HOT 1
- Ability to use predefined features from StyleSheet object.
- shadowOpacity
- No Longer under active development.
- [enhancement] Create gulp plugin HOT 2
- Version 2
- V2: package.json points to incorrect main HOT 10
- undefined is not a function (Symbol.iterator) HOT 2
- Unable to use interpolation in CSS HOT 5
- Little hack for code complete to who use VSCode! [suggestion] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-css.