"Simply the BESTiest CSS libary for text"
- a notourious chonky cat somewhere
A minimalist CSS library using variables (see bellow) to do:
- Chonkyness: 10
font-sizeclasses. - Notouriousnes: 2 text border sizes classes using a shadow, for visibility of text over mixed coloured backgrounds.
- Cuddliness: 2
line-heightclasses.
This library is licensed under a BSD-3-Clause License.
Simply use the ./css/lawd.css file from https://github.com/ncravino/lawd.css together with other libraries, imported before them. I like to use it with chota.css, which is great for a modern minimalist CSS lib for grids and some styling.
These classes allow you to change the size of the text, relative to --default-chonk-size.
The text size for head, body. h1-6 will also be set when including the lawd.css file.
.tinywill set thefont-sizeto--default-chonk-sizeminus0.3rem..thinwill set thefont-sizeto--default-chonk-sizeminus0.2rem..finewill set thefont-sizeto--default-chonk-sizeminus0.1rem..chonkwill be equal to--default-chonk-size, html and body will also be set to this size..heckinchonkerwill set thefont-sizeto--default-chonk-sizeplus0.1rem, h6 will also be set to this size..heftychonkwill set thefont-sizeto--default-chonk-sizeplus0.2rem, h5 will also be set to this size..megachonkwill set thefont-sizeto--default-chonk-sizeplus0.3rem, h4 will also be set to this size..gojirawill set thefont-sizeto--default-chonk-sizeplus0.4rem, h3 will also be set to this size..moonfacewill set thefont-sizeto--default-chonk-sizeplus0.5rem, h2 will also be set to this size..ohlawdwill set thefont-sizeto--default-chonk-sizeplus0.6rem, h1 will also be set to this size.
These classes allow you to add a border around each letter, in order to make it stand against backgrounds that have a mix of light and dark colours.
You can change the color overriding --default-notoriousness-colour which is rgba(128,128,128,0.5) by default, see variables bellow for more info.
.notoriouswill add avar(--default-cuddle-notouriousness)border using shadow around each letter. The default is 0.5px..blatantwill add avar(--default-blatant-notouriousness)border using shadow around each letter. The default is 0.8px.
These classes allow you to change the line-height.
The line-height set on import for body and html is --default-chonk-height which defaults to var(--default-chonk-size) + 0.2rem.
.cuddlywill changeline-heightto--default-cuddly-cuddlinesswhich defaults to1em..itfitswill changeline-heightto--default-itfits-cuddlinesswhich defaults to0.85em.
You can/should override any of the following variables:
--default-chonk-sizesets thefont-size, default is1.1rem--default-chonk-heightsets theline-height, default is--default-chonk-size + 2rem.--default-thin-notoriousnesssets the amount of pixels used by the shadow in.cuddly, default is 0.5px .--default-notoriousnesssets the amount of pixels used by the shadow in.itfits, default is 0.8px.--default-notoriousness-coloursets the colour of the shadow used by.cuddlyand.itfits, default isrgba(128, 128, 128, 0.5).--default-cuddle-cuddlinesssets theline-heightfor.cuddly, default is1em.--default-itfits-cuddlinesssets theline-heightfor.itfits, default is0.85em.
The following variables can be overriden but may cause unexpectedly funny results:
--default-negative-notoriousnesssets negative shadow pixels for.cuddly, automatically computed fromcalc(0px - var(--default-notoriousness)).--default-negative-thin-notoriousnesssets negative shadow pixels for.itfits, automatically ascalc(0px - var(--default-thin-notoriousness)).
Just create a :root element in a custom css file included after lawd.css and define what you want to change there, e.g.:
:root {
--default-chonk-size: 2rem;
}