Skip to content

Styling

One stylesheet system. The front end and the editor apply the same rules. Every path the theme loads is a file the production build emits.

Hand-written CSS against theme.json presets covers layout, type, and focus. The file stays in the tens of kilobytes. The front end enqueues it. add_editor_style() receives that same path. This holds only while the file contains no @layer.

functions.php
add_action( 'after_setup_theme', static function () {
add_theme_support( 'editor-styles' );
add_editor_style( 'assets/css/theme.css' );
} );
add_action( 'wp_enqueue_scripts', static function () {
wp_enqueue_style(
'theme',
get_theme_file_uri( 'assets/css/theme.css' ),
array(),
wp_get_theme()->get( 'Version' )
);
} );

Production CSS is minified. One feature does not add a second library beside the system already in use.