Custom CSS
What's allowed
Every problem the CSS tab reports, and how to fix it.
Anything that breaks a rule is left out; the rest still works. The CSS tab lists each problem under the editor with its line. Here’s what each one means.
Nothing loads from elsewhere
Your CSS can’t fetch anything, so no other site learns who visits your page.
blocked-url
A page cannot load anything from elsewhere, so url() is not allowed.
url() is refused everywhere.
:root {
background: url(https://example.com/cat.jpg); /* left out */
}
For a background picture, upload it in the Look tab and use
var(--linker-bg-image). See
the recipe.
blocked-function
This function is not allowed on a page.
Only these functions are allowed:
- Values:
var(),env(),attr(),counter(),counters() - Maths:
calc(),min(),max(),clamp(),round(),mod(),rem(),abs(),sign(),sin(),cos(),tan(),asin(),acos(),atan(),atan2(),pow(),sqrt(),hypot(),log(),exp() - Colour:
rgb(),rgba(),hsl(),hsla(),hwb(),lab(),lch(),oklab(),oklch(),color(),color-mix(),light-dark() - Gradients:
linear-gradient(),radial-gradient(),conic-gradient()and theirrepeating-forms - Transforms:
translate(),scale(),rotate()and theirX,Y,Zand3dforms,skew(),skewX(),skewY(),matrix(),matrix3d(),perspective() - Filters:
blur(),brightness(),contrast(),drop-shadow(),grayscale(),hue-rotate(),invert(),opacity(),saturate(),sepia() - Timing:
cubic-bezier(),steps(),linear() - Shapes:
inset(),circle(),ellipse(),polygon(),rect(),xywh(),path(),ray() - Layout:
minmax(),repeat(),fit-content(),anchor(),anchor-size(),scroll(),view()
Only what a page needs
blocked-at-rule
This at-rule is not allowed on a page.
Allowed: @media, @supports, @container, @starting-style, and
@keyframes at the top level. Nothing else, so no @import, @font-face,
@layer, @scope or @property.
For a font, pick a Google Font in the Look tab, or use fonts visitors already have:
:root {
font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, sans-serif;
}
nested-keyframes
@keyframes has to be at the top level of the stylesheet.
Put @keyframes at the top level, not inside @media or a rule:
/* Left out. */
@media (min-width: 30rem) {
@keyframes spin {
to {
rotate: 1turn;
}
}
}
/* Fine. */
@keyframes spin {
to {
rotate: 1turn;
}
}
Any name works; Linker renames it so it can’t clash.
blocked-property
This property is not allowed on a page.
behavior and -moz-binding are refused.
Real CSS
syntax-error
This could not be read as CSS, so it was left out.
Usually a missing ], ), } or ;. The message says what was expected:
[data-part="link" { /* "]" is expected */
color: red;
}
unknown-property
This is not a CSS property browsers know.
Usually a typo, like colour or boder-radius. Custom properties
(--anything) are always fine.
invalid-value
This value does not fit the property.
Like color: 12px, or an empty value. Values with var() always pass.
Size
too-large
The stylesheet is over the size limit, so none of it is used.
The limit is 32 KB. Over it, none of your CSS is used. The meter under the editor shows your size.
too-many-rules
The stylesheet has more rules than a page allows; the rest were left out.
Only the first 1,000 rules are used.
too-deep
Rules are nested deeper than a page allows.
Rules can be nested up to 8 deep.
Also worth knowing
- Comments are dropped from your page, but stay in the editor.
- When the rules change, your page follows. You don’t need to save again.