-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSS Convention - Scoping vs BEM vs OOCSS vs SMACSS #156
Comments
Not sure this feels like something Mantra should have an opinion on. With so many CSS Frameworks also used in UI development, it could be a bit hard to enforce. +, for most intents and purposes, BEM, SMACSS and OOCSS are very much variants of the same school of CSS thought. |
Since the React community is going forward with CSS in JS, that's a kind of way we can go. We started with few projects with that and we are loving that. Specially Radium allows us to do much better inline styling. And I also like CSS frameworks which abstract the CPU via some React components. These are two such good projects: |
I also agree with @adamdawkins that there are so many ways to deal with CSS and we can't enforce one such way. |
I feel much the same way about this as I do about enforcing strict linting styles: people feel too strongly about the way CSS is structured, and it has little bearing on the functionality of the app, so I don't think we should try to impose a standard here. It's basically an invitation for evangelism and arguments. |
There's definitely a lot of CSS methodologies out there just like there are lots of style recommendations for JavaScript. But it seems that Mantra is going to recommend an I do think that CSS in JS does seem to be the way forward after seeing this slide deck. |
I wrote an article on this too: https://voice.kadira.io/state-of-react-and-css-501d179443d3#.jwxj8y2ee |
The best tool I found so far is JSS. Pure js, and compiles to CSS. You create a javascript file which exports an object, and that object has all the style definitions (check out the playground). When you need those styles, you can simply import them (since they're JS files), and use It works well with mantra, since it doesn't need external compilers, and everything is self-contained. You can even write the definitions inside the component itself, and you don't have global style definitions, so everything is self contained in the component. |
@fermuch Hi! Did you try this https://github.com/jsstyles/react-jss? Cant make it work properly with mantra =( |
@v-anyukov take a look at this link. |
Does Mantra have a preferred CSS convention?
.template-name { .li { /* css */ } }
The text was updated successfully, but these errors were encountered: