grvcoelho / css-styleguide Goto Github PK
View Code? Open in Web Editor NEW:book: Opinionated CSS styleguide for scalable applications
License: MIT License
:book: Opinionated CSS styleguide for scalable applications
License: MIT License
Hello man!
First of all, great compilation, congratulations for your efforts. I also really like styleguides, rules, like yours.
I was thinking of a case today which it may be interesting of debating it with you. What about a case where my component is like, a ribbon. You know, in the corner of an element. I was thinking in some markup like this:
<div class="ribbon-container">
<div class="ribbon">New</div>
<h1>Etc...</h1>
<p>Lorem ipsum dolor sit amet.</p>
</div>
In this case, the ribbon-container is an ancestor/ascendant of the component, and not a descendant. How would you suggest it to be marked up? ribbon-container
? ribbon__container
? I never read too much about BEM and this kind of suggestions so if you know something about it, it would be interesting listening to you.
Happy to contribute somehow. My best wishes. Regards, Gio. Oh, by the way, I'm also a brazilian, so if you'd prefer to discuss it in portuguese, feel free to do that.
Quotes
Quotes are optional in CSS. You should use single quotes as it is visually clearer that the string is not a selector or a style property.
/* wrong /
.avatar {
background-image: url('/img/you.jpg');
font-family: 'Helvetica Neue Light', Helvetica Neue, Helvetica, Arial;
}
/ right */
.avatar {
background-image: url(/img/you.jpg);
font-family: Helvetica Neue Light, Helvetica Neue, Helvetica, Arial;
}
The "right" answer and "wrong" answer are switched based off of "You should use single quotes..."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.