Docs
Next

Component CSS blocks

Turn component CSS families on or off and configure their icons and counts with the blocks option.

On this page

The blocks option of systhema.config decides which component CSS families the Tailwind plugin emits, and configures the few that take settings (icons, column counts). Every block is on by default; turn off the ones a project does not use to keep the stylesheet small.

Configuring blocksLink to this section

Each key accepts a boolean. The blocks that take settings also accept an object; an object turns the block on unless it sets enabled: false, so false and { enabled: false } both disable a block.

systhema.config.ts
import type { SysthemaConfig } from '@systhemaui/core'

const config: SysthemaConfig = {
  blocks: {
    carousel: false,
    gallery: false,
    columns: { count: 6 },
    grid: { paddingCols: 8 },
    accordion: { openRotate: 45 },
  },
}

export default config

Your blocks object is merged into the defaults, so list only the blocks you change.

Every blockLink to this section

BlockDefaultSettingsEmits
rootVariableson–The :root token variables and [data-theme] bindings (Root variables)
variablesUtilitieson–variables, theme-* and sizing-* (Variable utilities)
applicationLayouton–Base layout rules: html, body, main, container, skip-link, figure
swiperon–Swiper base styles for Gallery and Carousel
gridonpaddingCols (6)Grid utilities, col-mx-0 to col-mx-<paddingCols>
gapon–Gap utilities
typographyon–Typography text style and color classes
linkon–Link
layouton–bg-layout-* (Colors)
containeron–*-container utilities (Container)
headeronsubNavigationIcon, menuIconHeader
footeron–Footer
articleon–Article
heroon–Hero
sectionon–Section spacing utilities
columnsoncount (4)Columns, columns-cols-1 to columns-cols-<count>
featureon–Feature
stackon–Stack
galleryonprevIcon, nextIconGallery
figureon–Figure width classes
richtexton–The richtext rhythm (Spacing model)
iconon–Icon
listoncheckedIcon, uncheckedIconList
mediaonoverlayIconImage, Video, MediaWrapper
carouselonwrapperPrevIcon, wrapperNextIcon, bottomPrevIcon, bottomNextIconCarousel
avataron–Avatar
buttononiconButton
chipon–Chip
cardon–Card
accordiononclosedIcon, openedIcon, openRotate (false)Accordion
quoteoniconQuote
separatoron–Separator
formonselectIcon, checkboxIconForm controls
postson–Posts module presentation (PostsList CSS)
cookieConsenton–Cookie consent banner

IconsLink to this section

Icon settings are CSS mask-image values. The icon is painted in the element's current color through the mask, so the SVG's own fill does not matter. Pass a data URL:

systhema.config.ts
const chevron = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960'%3E%3Cpath d='M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z'/%3E%3C/svg%3E")`

const config: SysthemaConfig = {
  blocks: {
    header: { subNavigationIcon: chevron },
    form: { selectIcon: chevron },
  },
}

Encode <, > and # in the SVG (%3C, %3E, %23) and use single quotes inside it, as above.

The header menu toggle takes either a pair of static icons or the built-in animated icon:

systhema.config.ts
const config: SysthemaConfig = {
  blocks: {
    header: { menuIcon: { type: 'animated' } },
  },
}

With type: 'static' (the default), set openIcon and closeIcon the same way as the other icons. For the accordion, openedIcon replaces closedIcon while an item is open, and openRotate rotates the icon by that many degrees when open (false, the default, does not rotate). Both icons also accept false: no closed icon, or no swap.

Blocks that borrow another block's classesLink to this section

Some component rules apply another block's utility instead of repeating its declarations: .form-label takes text-form-label, and formatted rich text takes the heading styles, link, quote, separator and the list classes. Those bindings follow the flag of the block that owns the class, so turning link off while keeping richtext on skips the link binding instead of breaking the build. See Components that borrow another block's classes.

Container blocks (stack, card, hero, columns and others) also suppress the scroll reveals of their children; see Child reveals.