-
When writing a string of multiple utility classes, always do so in an order with meaning. The "Concentric CSS" approach works well with utility classes (i.e,. 1. positioning/visibility 2. box model 3. borders 4. backgrounds 5. typography 6. other visual adjustments). Once you establish a familiar pattern of ordering, parsing through long strings of utility classes will become much, much faster so a little more effort up front goes a long way!
-
Always use fewer utility classes when possible. For example, use
mx-2instead ofml-2 mr-2and don't be afraid to use the simplerp-4 lg:pt-8instead of the longer, more complicatedpt-4 lg:pt-8 pr-4 pb-4 pl-4. -
Prefix all utility classes that will only apply at a certain breakpoint with that breakpoint's prefix. For example, use
block lg:flex lg:flex-col lg:justify-centerinstead ofblock lg:flex flex-col justify-centerto make it very clear that the flexbox utilities are only applicable at the
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const h=(t,p,...c)=>({t,p,c,k:p&&p.key}) | |
| export const render=(e,d,t=d.t||(d.t={}),p,r,c,m,y)=> | |
| // arrays | |
| e.map?e.map((e,p)=>render(e,d,t.o&&t.o[p])): | |
| // components | |
| e.t.call?(e.i=render((render.c=e).t(Object.assign({children:e.c},e.p),e.s=t.s||{},t=> | |
| render(Object.assign(e.s,t)&&e,d,e)),t.i||d,t&&t.i||{}),d.t=t=e):( | |
| // create notes | |
| m=t.d||(e.t?document.createElement(e.t):new Text(e.p)), | |
| // diff props |
If you are using this already, consider changes soon due the discussion around current ESX proposal.
Feel free to keep an eye on udomsay as that will be the implementation reference for consumers.
OlderNewer