concept

Css tokenization — CSS reference

Tokenization converts CSS input into units such as identifiers, dimensions and percentages; 12px is a dimension token while 5% is a percentage token. Whitespace can separate tokens, so 12 px is not the same dimension. Browsers do not expose their tokenizer directly through CSSOM. This example shows downstream acceptance and rejection, not a token dump.

Formal Syntax & Structure

css syntaxcss
margin: 12px 5%;

Working Example

Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>css-tokenization</title><style>body{margin:8px;font:16px/24px sans-serif;color:black;background:white}#a{box-sizing:border-box}#a{margin-left:12px;margin-left:12 px}</style><body><div id="a">Sample</div></body></html>
CSS Reference