Comments (2)
Suitcss is a full suite including a preprocessor. rscss is something you can apply to any css pre/post-processor.
Compared to BEM/suitcss, rscss is MUCH less verbose to write and maintain. The con, though, is that rscss recommends .my-component > .element
child selectors, which others may feel restricted with.
Smacss is great. In fact it's not mutually-exclusive with rscss, you can use ideas from both books together. You may even consider either book as a complement to the other's ideas.
I'd love to do a full chapter on all these, but I haven't been able to try either for enough time to say something insightful on the matter.
from rscss.
Thanks for the quick reply!
With regard to suitcss, I was mainly referring to the naming conventions and not the preprocessor:
https://github.com/suitcss/suit/blob/master/doc/naming-conventions.md
Though I think you addressed that with your comparison.
I agree it is more verbose but with preprocessors/postprocessors you can always do (ie. postcss):
.MyComponent {
&-element { }
}
which becomes .MyComponent-element { }
The biggest concern I see with .my-component > .element
is when someone/thing accidentally or on purpose does .my-other-component .element
and the side effects when you have this structure in html:
<div class="my-other-component">
<div class="my-component">
<div class="element"></div>
</div>
</div>
Also, rscss approach seems to require the maintainer to know the hierarchy/dom parent-child relationship where other naming conventions do not ie:
rscss:
.my-component > .element > .another-element
.another-element has to be a child of .element and has to be child of .my-component, if the html structure changes, so must the selectors.
conversely in SuitCSS naming:
.MyComponent {
&-element {}
&-anotherElement {}
}
.MyComponent-element and .MyComponent-anotherElement can be anywhere in the dom.
And then, of course, there is CSS Modules that automate css naming.
Though I know I'm perfectly capable of following rscss conventions without conflict and they are certainly less verbose in the html, I wonder if people with less experience with css and how child & descendant selectors work or simply have to refactor their html may run into bugs because of the hierarchy based selectors.
Thanks again!
from rscss.
Related Issues (20)
- Integration of Bootstrap // custom Themes // JS Plugins HOT 4
- RSCSS example sites HOT 8
- CSS Structure: About glob matching for Less HOT 2
- About FIle Structure HOT 1
- Propose a file structure HOT 6
- Projects that have used RSCSS HOT 1
- Translation to spanish HOT 5
- Nested components and fallback fonts for web fonts HOT 1
- Protuguese Translation HOT 1
- Suggestion for naming with multiple words to camelCase HOT 2
- How can I style deeply nested HTML elements using RSCSS? HOT 8
- AMCSS
- Class for namespace?
- How to handle nesting with grid css HOT 1
- Project state
- Extending variant depreciation HOT 1
- PR for clarify variant naming HOT 2
- Is it typo on nested-components.md?
- Create wiki HOT 3
- rscss.io offline HOT 4
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 rscss.