Comments (5)
Also I'm a bit confused how this is beneficial over:
module.exports = StyleSheet.create({
description: {
marginBottom: 20,
fontSize: 18,
textAlign: center,
color: #656656,
}
})
Seems to lose out on a bunch of important features like using variables for styles (eg, a colour variable) and integrating PixelRatio
when that helps. Curious what your solution is for this.
from react-native-css.
@brentvatne
for the first question, that was just a typo. margin-bottom
will be converted to marginBottom
. Everything will be camelCased, I need to add validation for the CSS subset.
As for the second question, I am hoping of solving this by introducing SASS, that way we can have partials, nested css, mixins and variables. I mainly did this project for my basic styling needs. I will look into pixelRatio
.
Benefits:
- writing styles in pure css
- separating styles from code
- improve style reusability
from react-native-css.
Isn't the reusability of those styles limited anyway since you're not using class or id prefixes? I assume those could be added in a pre-processor step, but somehow i doubt that you'd have the same classes on a website. (naming-wise).
The funny thing is that you're doing exactly the opposite of what react wants to promote (keeping styles in code) ;)
from react-native-css.
@johanneslumpe
https://github.com/iSimar/HackerNews-React-Native/blob/master/App/Views/Posts/Elements/PostCell/style.js
I agree but it might not be what everyone wants. Example above, where styling is outside of the react component.
from react-native-css.
@johanneslumpe agreed. I am using that approach. thanks for that example.
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
- nesting styles HOT 9
- 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.