<p>Keeping comma separated selectors on separate lines, adding a space after css properties with commasm and always having zeros before a decimal value assist in code legibility.</p>
<p>Adding extra formatting can help increase clarity in your code. We suggest separating css selectors on separate lines, adding a space after css properties with commas (like box-shadow) and placing a zero before any decimal value.</p>
// this should have spaces after commas and a zero before any decimal value
.ui.widget {
.ui.widget {
// this should have spaces after the commas and a decimal should aways have a leading zero
color:rgba(0,0,0,.3);
color:rgba(0,0,0,.3);
}
}
// more legible
// easier to read
.ui.widgets .widget,
.ui.widgets .widget,
.ui.widget,
.ui.widget,
.ui.widgets .widget.type,
.ui.widgets .widget.type,
.ui.widget.type {
.ui.widget.type {
color: #FFFFFF;
color: #FFFFFF;
}
}
// spaces and zeros
// properly formatted
.ui.widget {
.ui.widget {
color: rgba(0, 0, 0, 0.3);
color: rgba(0, 0, 0, 0.3);
}
}
@ -190,7 +190,7 @@ type : 'UI Specification'
</div>
</div>
<h4class="ui header">Grammatical order</h4>
<h4class="ui header">Grammatical order</h4>
<p>Consider using similar class syntax as if you were actually describing the element in english. Although this is by no means required it may help provide clarity in some circumstances.</p>
<p>Consider using similar class syntax as if you were actually describing the element in English. Although this is by no means required it may help provide clarity in some circumstances.</p>
<divclass="code"data-type="css">
<divclass="code"data-type="css">
// confusing word order
// confusing word order
.ui.red.button.pointing {
.ui.red.button.pointing {
@ -218,7 +218,7 @@ type : 'UI Specification'
<h2class="ui dividing header">Units and Measurements</h2>
<h2class="ui dividing header">Units and Measurements</h2>
<p>EMs are defined so that 1em is equal to the current font size inside of an element. Using EMs can allow you to size content inside an element in proportion to the overall size of the element. Be careful though because this will stack with nested elements</p>
<p>EMs are defined so that 1em is equal to the current font size inside of an element. Using EMs can allow you to size content inside an element in proportion to the overall size of the element. Be careful though because this will stack with nested elements.</p>
<p>Using EMs multiplicative nature can often be used to your advantage. Instead of defining multiple tiers of a menu system. Consider using ems for its sizing. As you continue to nest menu elements each nested menu will computer its values with smaller proportions.</p>
<p>Using EMs multiplicative nature can be used to your advantage. Instead of defining multiple tiers of a menu system, consider using ems to reduce each tier's sizing. As you continue to nest menu elements each nested menu will computer its values with smaller proportions.</p>
<p>REMs are defined so that 1rem is equal to 1 em on the html tag of the page. This is needed to explain how content should be sized related to the overall size of elements on the page</p>
<p>Relative EMs (rems) are calculated relative to the font size of the entire page. This is needed to explain how content should be sized related to the overall size of elements on the page, and will not increase geometrically when nested like EMs.</p>