Customization

Syntax Rules

A guide to adding custom syntax rules.

Overview

NametypeUnitVariable Namespaces
accent-colorNative-color
align-contentNative--
align-itemsNative--
align-selfNative--
animationNativeShorthand--
animation-delayNativems-
animation-directionNative--
animation-durationNativems-
animation-fill-modeNative--
animation-iteration-countNative--
animation-nameNative--
animation-play-stateNative--
animation-timing-functionNative--
appearanceNative--
aspect-ratioNative--
backdrop-filterNative-color
backgroundNativeShorthand-color
background-attachmentNative--
background-blend-modeNative--
background-clipNative--
background-colorNative-color
background-imageNative-color
background-originNative--
background-positionNativepx-
background-repeatNative--
background-sizeNativerem-
blur()---
borderNativeShorthandremcolor, color.line
border-bottomNativeShorthandremcolor, color.line
border-bottom-colorNative-color, color.line
border-bottom-left-radiusNativeremborder-radius
border-bottom-radiusShorthandremborder-radius
border-bottom-right-radiusNativeremborder-radius
border-bottom-styleNative--
border-bottom-widthNativerem-
border-collapseNative--
border-colorNativeShorthand-color, color.line
border-imageNativeShorthand--
border-image-outsetNativerem-
border-image-repeatNative--
border-image-sliceNative--
border-image-sourceNative--
border-image-widthNativerem-
border-leftNativeShorthandremcolor, color.line
border-left-colorNative-color, color.line
border-left-radiusShorthandremborder-radius
border-left-styleNative--
border-left-widthNativerem-
border-radiusNativeShorthandrem-
border-rightNativeShorthandremcolor, color.line
border-right-colorNative-color, color.line
border-right-radiusShorthandremborder-radius
border-right-styleNative--
border-right-widthNativerem-
border-spacingNativeremspacing
border-styleNativeShorthand--
border-topNativeShorthandremcolor, color.line
border-top-colorNative-color, color.line
border-top-left-radiusNativeremborder-radius
border-top-radiusShorthandremborder-radius
border-top-right-radiusNativeremborder-radius
border-top-styleNative--
border-top-widthNativerem-
border-widthNativeShorthandrem-
border-xShorthandremcolor, color.line
border-x-colorShorthand-color, color.line
border-x-styleShorthand--
border-x-widthShorthandrem-
border-yShorthandremcolor, color.line
border-y-colorShorthand-color, color.line
border-y-styleShorthand--
border-y-widthShorthandrem-
bottomNativeremspacing
box-decoration-breakNative--
box-shadowNativeremcolor
box-sizingNative--
break-afterNative--
break-beforeNative--
break-insideNative--
brightness()---
caret-colorNative-color, color.text
clearNative--
clip-pathNative--
colorNative-color.text
column-gapNativeremspacing
column-spanNative--
columnsNativeShorthand--
containNative--
containerNativeShorthand--
container-nameNative--
container-typeNative--
contentNative--
contrast()---
counter-incrementNative--
counter-resetNative--
cursorNative--
cxNative-spacing
cyNative-spacing
directionNative--
displayNative--
drop-shadow()--color
fillNative-color
filterNative-color
flexNativeShorthand--
flex-basisNativerem-
flex-directionNative--
flex-growNative--
flex-shrinkNative--
flex-wrapNative--
floatNative--
fontNativeShorthand-font-family, font-variant, font-weight, font-size, font-style
font-familyNative--
font-feature-settingsNative--
font-sizeNativerem-
font-smoothNative--
font-styleNativedeg-
font-variantNativeShorthand--
font-variant-numericNative--
font-weightNative--
gapNativeShorthandremspacing
gradient()--color
grayscale()---
gridNativeShorthand--
grid-areaNativeShorthand--
grid-auto-columnsNative--
grid-auto-flowNative--
grid-auto-rowsNative--
grid-columnNativeShorthand--
grid-column-endNative--
grid-column-spanShorthand--
grid-column-startNative--
grid-columnsShorthand--
grid-rowNativeShorthand--
grid-row-endNative--
grid-row-spanShorthand--
grid-row-startNative--
grid-rowsShorthand--
grid-templateNativeShorthand--
grid-template-areasNative--
grid-template-columnsNativerem-
grid-template-rowsNativerem-
groupShorthand--
heightNativerem-
hue-rotate()---
hyphensNative--
insetNativeShorthandremspacing
invert()---
isolationNative--
justify-contentNative--
justify-itemsNative--
justify-selfNative--
leftNativeremspacing
letter-spacingNativeem-
line-heightNative--
list-styleNativeShorthand--
list-style-imageNative--
list-style-positionNative--
list-style-typeNative--
marginNativeShorthandremspacing
margin-bottomNativeremspacing
margin-inlineNativeShorthandremspacing
margin-inline-endNativeremspacing
margin-inline-startNativeremspacing
margin-leftNativeremspacing
margin-rightNativeremspacing
margin-topNativeremspacing
margin-xShorthandremspacing
margin-yShorthandremspacing
mask-imageNative--
matrix()---
matrix3d()---
max-heightNativerem-
max-sizeShorthandrem-
max-widthNativerem-
min-heightNativerem-
min-sizeShorthandrem-
min-widthNativerem-
mix-blend-modeNative--
object-fitNative--
object-positionNative--
opacityNative--
opacity()---
orderNative--
outlineNativeShorthandremoutline-width, outline-style, outline-offset, outline-color, color.line, color
outline-colorNative-color, color.line
outline-offsetNativeremspacing
outline-styleNative--
outline-widthNativerem-
overflowNativeShorthand--
overflow-wrapNative--
overflow-xNative--
overflow-yNative--
overscroll-behaviorNativeShorthand--
overscroll-behavior-xNative--
overscroll-behavior-yNative--
paddingNativeShorthandremspacing
padding-bottomNativeremspacing
padding-inlineNativeShorthandremspacing
padding-inline-endNativeremspacing
padding-inline-startNativeremspacing
padding-leftNativeremspacing
padding-rightNativeremspacing
padding-topNativeremspacing
padding-xShorthandremspacing
padding-yShorthandremspacing
perspective()---
place-contentNativeShorthand--
place-itemsNativeShorthand--
place-selfNativeShorthand--
pointer-eventsNative--
positionNative--
quotesNative--
resizeNative--
rightNativeremspacing
rotate()---
rotate3d()---
rotateX()---
rotateY()---
rotateZ()---
row-gapNativeremspacing
rxNative--
ryNative--
saturate()---
scale()---
scale3d()---
scaleX()---
scaleY()---
scaleZ()---
scroll-behaviorNative--
scroll-marginNativeShorthandremspacing
scroll-margin-bottomNativeremspacing
scroll-margin-leftNativeremspacing
scroll-margin-rightNativeremspacing
scroll-margin-topNativeremspacing
scroll-margin-xShorthandremspacing
scroll-margin-yShorthandremspacing
scroll-paddingNativeShorthandremspacing
scroll-padding-bottomNativeremspacing
scroll-padding-leftNativeremspacing
scroll-padding-rightNativeremspacing
scroll-padding-topNativeremspacing
scroll-padding-xShorthandremspacing
scroll-padding-yShorthandremspacing
scroll-snap-alignNative--
scroll-snap-stopNative--
scroll-snap-typeNative--
sepia()---
shape-image-thresholdNative--
shape-marginNativeremspacing
shape-outsideNative--
sizeShorthandrem-
skew()---
skewX()---
skewY()---
strokeNative-color
stroke-dasharrayNative--
stroke-dashoffsetNative-spacing
stroke-widthNative--
table-layoutNative--
text-alignNative--
text-decorationNativeShorthandremcolor, color.text
text-decoration-colorNative-color, color.text
text-decoration-lineNative--
text-decoration-styleNative--
text-decoration-thicknessNativeem-
text-fill-colorNative-color, color.text
text-indentNativerem-
text-orientationNative--
text-overflowNative--
text-renderingNative--
text-shadowNativeremcolor
text-sizeShorthandremfont-size
text-strokeNativerem-
text-stroke-colorNative-color
text-stroke-widthNativerem-
text-transformNative--
text-truncateShorthand--
text-underline-offsetNativeremspacing
text-underline-positionNative--
text-wrapNativeShorthand--
topNativeremspacing
touch-actionNative--
transformNative-spacing
transform-boxNative--
transform-originNativepx-
transform-styleNative--
transitionNativeShorthand--
transition-delayNativems-
transition-durationNativems-
transition-propertyNative--
transition-timing-functionNative--
translate()-remspacing
translate3d()-remspacing
translateX()-remspacing
translateY()-remspacing
translateZ()-remspacing
user-dragNative--
user-selectNative--
variableShorthand--
vertical-alignNative--
visibilityNative--
white-spaceNative--
widthNativerem-
will-changeNative--
word-breakNative--
word-spacingNativeem-
writing-modeNative--
xNative-spacing
yNative-spacing
z-indexNative--

In Master CSS, most syntax rules are defined and implemented through the config.rules. You can create your own custom syntax rules and use them directly within the class="" attribute.

These custom rules are fully compatible with Master CSS’s advanced features, including selectors, at-rules, functions, and variables—offering a powerful and flexible styling experience.

Use this as a last resort when implementing your design system or styling conventions. Avoid creating custom syntax rules unless absolutely necessary, as overuse can lead to reduced maintainability and consistency across your codebase.


Add a custom syntax rule

Create your own syntax rule.

export default {    rules: {        foo: {             unit: 'rem',             declarations: {                 width: undefined             }         }     }}

Use it in your markup:

<div class="foo:32"></div>

Generated CSS:

.foo\:32 {    width: 2rem;}

Master CSS does not provide methods like declare or transform to let you fully customize the syntax, but instead exposes limited transformers and declarers to let you extend practical syntax rules. You should rely on the implicit behavior built into Master CSS to achieve the desired effect, but more often than not you will need config.components.


Syntax rule types

Master CSS uses SyntaxRuleType to determine the priority of CSS rule generation. By default, each rule is intentionally ordered to minimize style conflicts and reduce the need for overrides.

enum SyntaxRuleType {    /**     * utility classes     * @example block, inline     */    Utility = -4,    /**     * native shorthand     * @example border, padding, margin     */    NativeShorthand = -3,    /**     * shorthand     * @example px, py, mx, my     */    Shorthand = -2,    /**     * native properties     * @example color, background-color, font-size     */    Native = -1,    /**     * normal     * @example grid-cols     */    Normal = 0,}export default SyntaxRuleType

  • Master UI


© 2025 Aoyue Design LLC.MIT License
Trademark Policy