CSS275 Documents

Property Order

Sort CSS property declarations alphabetically within each selector. Keep @apply directives separate from the property order.

Correct

.item {
    @apply border;
    background: var(--surfaceColor);
    border-color: var(--lineColor);
}

Incorrect

.card {
    border-color: var(--lineColor);
    background: var(--surfaceColor);
}

Exceptions

  • Preserve source order when a shorthand and one of its longhands intentionally override each other.

Fix

Reorder CSS properties alphabetically without changing the order of repeated fallback values for one property.