Confirmed users
591
edits
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS | * Must read "Writing Efficient CSS": https://developer.mozilla.org/en/CSS/Writing_Efficient_CSS; | ||
* Code must be test in RTL. Use the [https://addons.mozilla.org/en-US/firefox/addon/force-rtl/ Force RTL extension]; | |||
* For RTL compatibility, for margins, padding and borders, don't use <tt>*-left</tt> or <tt>*-right</tt> but <tt>*'''-start'''</tt> and *'''-end'''); | |||
* write "padding: 0 3px 4px;" instead of "padding: 0 3px 4px 3px;". This makes it more obvious that the padding is symmetrical (so RTL won't be an issue); | |||
* Usually, if a margin or padding has 4 values, something is wrong. If the left and right values are asymmetrical, you're supposed to use <tt>-start</tt> and <tt>-end</tt>. If the values are symmetrical, so use only 3 values (see previous tip); | |||
if 4 values | * replace <tt>0px/0em/…</tt> by <tt>0</tt>; | ||
* some values depends on the OS theme. Use template (?) values for (<tt>-moz-dialog</tt> or <tt>@toolbarbuttonCornerRadius@</tt>) (FIXME Is there a list somewhere?); | |||
* Avoid magic numbers, privilege automatic sizing; | |||
* In a selector: <tt>s/[checked="true"]/[checked]</tt> | |||
s/[checked="true"]/[checked] | |||
> border: 1px solid hsla(210,8%,5%,.6); | > border: 1px solid hsla(210,8%,5%,.6); | ||