v20221213
box-sizing: border-box
), margin is not#XXXXXX30
= color #XXXXXX w/ 30% alpha transparencywill-change
over translate3d(0,0,0)
for elements likely to changeAvoid these. They are slower, increase specificity and can’t be used for different elements
ul.list {}
Sometimes qualified selectors make a classname more semantic, but a better alternative is quasi-qualified selectors
/*ul*/.list {}
Inline styles - Example: <h1 style="color: pink;">
IDs - Example: #navbar
Classes, pseudo-classes, attribute selectors - Example: .test
, :hover
, [href]
Elements and pseudo-elements - Example: h1
, :before
Start at 0, add 100 for each ID value, add 10 for each class value (or pseudo-class or attribute selector), add 1 for each element selector or pseudo-element.
There is one exception to this rule: if you use the !important rule, it will even override inline styles!
flex:1;
will evenly distribute everything - at what proportion should the item scale myself up or downflex
(short form) is flex-grow
, flex-shrink
, flex-basis
flex-flow
(short form) is flex-direction
, flex-wrap
flex-grow
: what do we do with the extra spaceflex-shrink
: what do we do with not enough space - how much do i give uporder:0;
is defaultalign-items:baseline
is more useful than expected, by aligning the bottom of words/copy.align-content
determines the spacing between lines. When there is only one line, align-content has no effectalign-items
determines how the items as a whole are aligned within the containeralign-self
determines how the item is aligned within the container. It has the same properties as align-items.* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }
OR adding via the console
:
let module_ui = document.createElement("style");
module_ui.type = 'text/css';
module_ui.setAttribute("data-id","glitch-id-element");
let module_ui_content = `
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
* * * * * * * { background-color: rgba(255,0,0,.2); }
* * * * * * * * { background-color: rgba(0,255,0,.2); }
* * * * * * * * * { background-color: rgba(0,0,255,.2); }`;
module_ui.appendChild(document.createTextNode(module_ui_content));
document.getElementsByTagName("head")[0].appendChild(module_ui);