-
Notifications
You must be signed in to change notification settings - Fork 12
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 Styleguide #30
Comments
We used BEM on climatescope and if I recall correctly it was an interesting approach but had some quirks. @ricardomestre can shed some more light on that. Nesting classes is one of the more powerful features of preprocessors as it allows you to neatly organize and group your code. Of course, you need some common sense and not do Regarding the js specific classes, I agree with the prefix Quick example: <a href="#" data-hook="click">Click me</a> var btn = document.querySelectorAll('[data-hook="click"]'); You can even have multiple actions, just separate them with <a href="#" data-hook="click stick">Will stick</a>
<a href="#" data-hook="click">Will not stick</a> var btn = document.querySelectorAll('[data-hook~="stick"]'); With this you don't mix styling with interactivity. My two cents :) |
👍 to this whole conversation and also data-hooks. I'll read through the rest of the materials you sent, @dereklieu |
Also wanna 👍 to the conversation overall (thanks for starting it On Tue, Aug 4, 2015 at 10:40 AM Drew Bollinger [email protected]
|
A quick google search propped up this scss linter which seems to have some options. Downside is that it's a ruby gem, which might be annoying to include in our build process. I'll keep looking around. For anyone else doing reading into this, I should mention that the other competing style-guides are object-oriented (OOCSS) and SMACSS. Again, these are not necessarily fun reads ⚡ but worth looking into when you have a moment. |
Ping. Anyone still have any interest in this? |
I know @ricardomestre has been thinking a lot about this, or at least about things tangential to this. |
We adhere to a styleguide for writing javascript - do we want to adhere to one for writing CSS?
There are a few competing philosophies right now regarding CSS naming conventions. For example: block element modifier, or BEM.
These are all kind of hard to digest or even read. I do recommend reading the trello css guide though.
Overall I think the current Devseed state of the CSS, as far as I've seen, is pretty good in that we're breaking out stylesheets into modules and using preprocessors. I do think there is a good argument against nesting classes, and I often use non-class selectors. I also like the convention of prefixing javascript-specific classes with
js-
and utility classes withu-
.Would love to hear people's thoughts on this, especially if you write a lot of CSS.
@developmentseed/development-seed
The text was updated successfully, but these errors were encountered: