Minor quibble: set the padding to 1em 0.75em 0.9em instead of 1em 0.75em. Having slightly smaller padding on the bottom improves the proportions when using all caps (or letters without tails).
I get the concept of using multiple classes to modify a base style (class="btn btn-small") and even using delimiters in multi-part classnames so you can use regular expressions in your CSS to select groups of classes that conform to a naming convention (I.e. [class^="btn-"] {color:red} would make both class="btn-small" and class="btn-large" red).
What is the advantage to a double delimiter over using a single delimiter? (btn--small)
15 comments
[ 5.4 ms ] story [ 2128 ms ] thread> Centered, full-width on mobile, with a max-width of 16em on larger screens.
They are Block--Element__Modifiers (BEM). It's a style of css meant for developer readability and code reuse.
In this instance you have the following:
.btn { //the base code for a button }
.btn--s { font-size: 12px; }
.btn--m { font-size: 14px; }
.btn--l { font-size: 20px; border-radius: .25em!important; }
Now if I want to make two buttons, one with small font, the other with large font, I can simply do this:
<button class="btn btn--s"></button> <button class="btn btn--l"></button>
Personally, I like writing with BEM methodology rather than repeating style rules over multiple classes.
What is the advantage to a double delimiter over using a single delimiter? (btn--small)
Also see the .site-search example here http://csswizardry.com/2013/01/mindbemding-getting-your-head...
i want a button, not a border.