Sass Mixins

The screen mixins let your own SCSS target the same conditions the responsive utilities do: device size, orientation, and bit depth. The scale functions wrap pixel values so your CSS scales with the device the way framework CSS does.

@use 'framework/mixins' as trmnl;

.forecast-tile {
    border: 1px solid var(--black);

    // 1-bit screens: thicker rule so the dithered edge stays legible.
    @include trmnl.for-1bit {
        border-width: 2px;
    }

    // md and larger screens in portrait.
    @include trmnl.screen('md', 'portrait') {
        padding: 20px;
    }
}

A mixin wraps the current rule in the matching screen ancestor: the 1-bit block above compiles to .trmnl .screen--1bit .forecast-tile.

#

Scale Functions

Each function wraps a pixel value in one of the framework's scale variables. Non-px and zero values pass through unchanged; lists are scaled item by item.

  • content-scaled($value): multiplies by --content-scale. Use for plugin content geometry.
  • ui-scaled($value): multiplies by --ui-scale, which includes device density. Use for geometry that should scale like the framework's own components.
  • text-ui-scaled($value): multiplies by --text-ui-scale, which includes density, Scale, and Text Scale. Use for typography.
@use 'framework/mixins' as trmnl;

.forecast-tile {
    padding: trmnl.content-scaled(10px);
    // => padding: calc(10px * var(--content-scale, 1));
}
#

Public Surface

framework/mixins forwards every module the framework compiles itself with, which is far more than it supports. Three families are public: their names and signatures hold from one release to the next, and the docs cover them page by page.

Everything else the module forwards is internal: the selector helpers (scope-selector, generate-screen-utilities) and the variant emitters (with-all-variants, generate-triple-variants). The internal set also includes the shared utility emitters, the pattern, border-level, and text-paint helpers, and the trmnl-namespace wrapper. They exist to compile the framework's own classes and can change or disappear in any release, with no deprecation notice and no entry in the release notes.

The same split holds inside a public module: a member the docs do not name is internal even when it sits next to one they do. The device configuration is public and documented on Custom Devices ; the whole SCSS contract is summarized on Sass API .