@heydonworks
Anything can not be best practice
h1 {
font-family: headings, serif;
color: black; font-size: 2.5em; }
h1 {
font-family: headings, serif;
color: black; font-size: 2.5em; }
h1 { line 06 main.css
color: #000000;
font-family: headings, serif;
font-size: 2.5em;
}
<div class="button">click me, baby</div>
h1 {
font-family: Asshole Script, cursive;
}
✔<nav>
✔role="navigation"
✔nav
✔[role="navigation"]
PRESENT: [role="navigation"] in the CSS
NOT PRESENT: role="navigation" in the HTML
“A state is something that augments and overrides all other styles. For example, an accordion section may be in a collapsed or expanded state.”
SMACSS
.tab {
background-color: purple;
color: white;
}
.is-tab-active {
background-color: white;
color: black;
}
.tab {
background-color: purple;
color: white;
}
.is-tab-active {
background-color: white;
color: black;
}
Classes only define appearance of state
[role="tab"] {
background-color: purple;
color: white;
}
[role="tab"][aria-selected] {
background-color: white;
color: black;
}
.tabs-blue {}
.tabs-black {}
.tabs-orange {}
“Tie CSS display property to WAI-ARIA hidden state”
[aria-hidden="true"] { display: none; }
“But my application has 20 different button types.
How do I differentiate all of those
without classes??”
<a class="topcoat-button">Button</a>
(modularity)
↓
A Front-end Developer asks
A Designer asks
Not part of best practices