Checkbox hack
• Custom Radio Buttons and Checkboxes
• Tree menu
• Tabbed areas
• Dropdown menus
• Push Toggles
Slide 35
Slide 35 text
What you shall not do with CSS
Slide 36
Slide 36 text
Avoid CSS inline styles
lorem ipsum
lorem ipsum
HTML
Slide 37
Slide 37 text
Do not use IDs for styling
BAD
#widget {
border: 1px solid #357ebd;
}
GOOD
.widget {
border: 1px solid #357ebd;
}
CSS CSS
Slide 38
Slide 38 text
Never use !important reactively
BAD
.toolbar .btn {
border: none !important;
}
.btn {
border: 1px solid #357ebd;
width: 200px;
}
CSS
Slide 39
Slide 39 text
Do not override styles, but extend
BAD
.btn {
border: 1px solid #357ebd;
width: 200px;
}
.toolbar .btn {
border: none;
}
GOOD
.btn {
width: 200px;
}
.btn-outlined {
border: 1px solid #357ebd;
}
CSS CSS
Slide 40
Slide 40 text
How you shall deal with CSS
Slide 41
Slide 41 text
Be aware that browsers read
selectors from right to left
Slide 42
Slide 42 text
.feed nav ul li h2
CSS
Slide 43
Slide 43 text
h2
h2
h2
h2
h2
h2
h2
h2
h2
li
li
li
li
li
li
li
li
li
li
ul
ul
ul
u
nav
nav
CSS
Slide 44
Slide 44 text
h2
h2
h2
h2
h2
h2
h2
h2
h2
li
li
li
li
li
li
li
li
li
li
ul
ul
ul
u
nav
nav
.feed
CSS
Slide 45
Slide 45 text
h2
h2
h2
h2
h2
h2
h2
h2
h2
li
li
li
li
li
li
li
li
li
li
ul
ul
ul
u
nav
nav
.feed
CSS
Slide 46
Slide 46 text
.feed nav ul li h2
.feed-heading
CSS
Slide 47
Slide 47 text
Use relative typography
Slide 48
Slide 48 text
/* Global scope */
html {
font-size: 62.5%; /* 10px */
}
/* Components */
.header {
font-size: 1.6rem;
}
/* scale with components */
h1 {
font-size: 2em;
}
Lorem ipsum
Lorem ipsum
16px
h1: 32px
.header
CSS OUTPUT
Slide 49
Slide 49 text
/* Global scope */
@media (max-width: 960px) {
html {
font-size: 56.25%; /*9px*/
}
}
/* Components */
.header {
font-size: 1.6rem;
}
/* scale with components */
h1 {
font-size: 2em;
}
Lorem ipsum
Lorem ipsum
14.4px
h1: 28.8px
.header
CSS OUTPUT
Slide 50
Slide 50 text
Split your CSS into modules
Slide 51
Slide 51 text
@import "./main-menu.css";
@import "./panel.css";
MAIN.CSS PANEL.CSS
/* Here go style for panel
widget only */
.panel {
}
BUTTONS.CSS
/* Here go styles for any
buttons used in the project */
.btn {
}
@import "./buttons.css";