gillish

Control how Cairnstone loads its styles

A page loads the styles of the Cairnstone blocks A piece of a page, such as a paragraph, a picture or a button. In WordPress you build a page by putting blocks one after another. it holds, and none of Cairnstone’s when it holds none. Within a block, it loads only what the block shows: a colour set’s styles only when a block uses one, a rating’s only when one is shown, and a How-to’s image rules only when a step has an image. The editor always loads everything, so every choice looks right while you write.

Small style sheets are printed straight into the page, so the browser does not wait for a separate file. A larger one, such as the Video block’s, stays a file, which the browser keeps for the next page.

WordPress limits how much style it prints into a page (40,000 bytes to start with). On a page with Cairnstone blocks, Cairnstone adds the size of its own small sheets to that limit, so they never push your theme The design of your whole site: its fonts, colours and where the menu and footer go. You pick it under Appearance, then Themes.‘s or WordPress’s styles out into separate files. On other pages the limit is untouched.

For developers

Add these lines to a small plugin An add-on you install in WordPress to give your site new features. Gillish Cairnstone and Gillish Core are plugins. or your child theme’s functions.php.

Every style sheet as a file, for example when your Content-Security-Policy forbids inline styles: set WordPress’s limit to 0. Cairnstone then prints nothing into the page.

PHP
add_filter( 'styles_inline_size_limit', '__return_zero' );

WordPress’s limit as it is: stop Cairnstone adding its share.

PHP
add_filter( 'gillish_cs_inline_style_share', '__return_false' );

Next, read Add breadcrumbs with structured data.

Trails

Cairnstone