Skip to content

UI Utility Mixin And Functions

A collection of utility mixins and functions for layout, spacing, controls, and state management.

Marged

Applies margin styles to non-last children unless the element has .is-marginless.

Signature:

scss
@mixin marged($except-last: BOOLEAN = true);

Example:

scss
.list-item {
  @include termeh.marged {
    margin-bottom: 1rem;
  }
}

Marginless

Removes bottom margin from non-last, non-marginless elements.

Signature:

scss
@mixin marginless();

Example:

scss
.list-item {
  @include termeh.marginless;
}

Padded

Applies padding styles unless the element has .is-paddingless.

Signature:

scss
@mixin padded();

Example:

scss
.card {
  @include termeh.padded {
    padding: 1rem;
  }
}

Paddingless

Removes padding from elements with .is-paddingless.

Signature:

scss
@mixin paddingless();

Example:

scss
.card {
  @include termeh.paddingless;
}

Shadow

Generates a standard box-shadow with transparency based on offsets and base color.

Signature:

scss
@function shadow($x: NUMBER, $y: NUMBER, $color: COLOR): LIST;

Example:

scss
.panel {
  box-shadow: termeh.shadow(2px, 4px, #000);
}

Soft-Shadow

Generates a softer, more diffused shadow.

Signature:

scss
@function soft-shadow($x: NUMBER, $y: NUMBER, $color: COLOR): LIST;

Example:

scss
.panel {
  box-shadow: termeh.soft-shadow(2px, 6px, #000);
}

Flat-Shadow

Generates a flat, even drop shadow.

Signature:

scss
@function flat-shadow($size: NUMBER, $color: COLOR): LIST;

Example:

scss
.box {
  box-shadow: termeh.flat-shadow(10px, rgba(0, 0, 0, 0.2));
}

Child-Radius

Computes child border-radius given parent radius and inner padding.

Signature:

scss
@function child-radius($parent-radius: NUMBER, $padding: NUMBER): NUMBER;

Example:

scss
.card .media {
  border-radius: termeh.child-radius(16px, 8px);
}

Clearfix

Classic clearfix using ::after.

Signature:

scss
@mixin clearfix();

Example:

scss
.columns {
  @include termeh.clearfix;
}

Overflow-Touch

Enables momentum scrolling on iOS.

Signature:

scss
@mixin overflow-touch();

Example:

scss
.scroll-area {
  @include termeh.overflow-touch;
}

Locked

Disables pointer events and text selection.

Signature:

scss
@mixin locked();

Example:

scss
button {
  &.is-disabled,
  &.is-loading {
    @include termeh.locked;
  }
}

Unselectable

Disables text selection across browsers.

Signature:

scss
@mixin unselectable();

Example:

scss
.badge {
  @include termeh.unselectable;
}

Selectable

Re-enables text selection.

Signature:

scss
@mixin selectable();

Example:

scss
.non-disabled {
  @include termeh.selectable;
}

Placeholder

Cross-browser placeholder styling.

Signature:

scss
@mixin placeholder();

Example:

scss
input[type="text"] {
  @include termeh.placeholder {
    color: rgba(0, 0, 0, 0.45);
  }
}

Reset

Resets form-control styles to a clean baseline.

Signature:

scss
@mixin reset();

Example:

scss
input,
select,
textarea {
  @include termeh.reset;
}

Control

Base control styling (includes reset and focus/disabled normalization).

Signature:

scss
@mixin control();

Example:

scss
.input,
.select,
button {
  @include termeh.control;
}

Scrollbar

Customizes scrollbar width, track, thumb, and hover thumb color (WebKit).

Signature:

scss
@mixin scrollbar(
  $width: NUMBER,
  $track: COLOR = null,
  $thumb: COLOR = null,
  $thumb-hover: COLOR = null
);

Example:

scss
.table-wrapper {
  @include termeh.scrollbar(8px, #f6f6f6, #bfbfbf, #8c8c8c);
}

Scroll-Color

Updates only the scrollbar thumb hover color.

Signature:

scss
@mixin scroll-color($color: COLOR);

Example:

scss
.table-wrapper {
  &.is-dark {
    @include termeh.scroll-color(#666);
  }
}

Spinner

Base spinner element (intended for pseudo-elements).

Signature:

scss
@mixin spinner($size: NUMBER, $color: COLOR, $width: NUMBER);

Example:

scss
.button {
  &.is-loading::after {
    @include termeh.spinner(1.25rem, #3498db, 2px);
  }
}

Spinner-Color

Updates the spinner’s visible stroke color.

Signature:

scss
@mixin spinner-color($color: COLOR);

Example:

scss
.button {
  &.is-red {
    &.is-loading::after {
      @include termeh.spinner-color(#e74c3c);
    }
  }
}

Loader

Centered loading spinner via ::after.

Signature:

scss
@mixin loader($size: NUMBER, $color: COLOR, $width: NUMBER);

Example:

scss
.card {
  &.is-loading {
    @include termeh.loader(2rem, #555, 3px);
  }
}

Loader-Color

Updates the loader’s spinner color.

Signature:

scss
@mixin loader-color($color: COLOR);

Example:

scss
.card {
  &.is-red {
    &.is-loading {
      @include termeh.loader-color(#c0392b);
    }
  }
}

Overlay

Creates a full-cover overlay via ::before, with optional backdrop-filter.

Signature:

scss
@mixin overlay($color: COLOR, $opacity: NUMBER, $filter: CSS-FILTER);

Example:

scss
.dialog[aria-modal="true"] {
  @include termeh.overlay(black, 0.5, blur(6px));
}

Is-Ltr

LTR-only styles. Applies styles when the global direction is left-to-right, or the element has the .is-ltr class, or matches the :dir(ltr) selector.

Signature:

scss
@mixin is-ltr();

Example:

scss
.container {
  @include termeh.is-ltr {
    text-align: left;
    margin-left: auto;
  }
}
Dependencies

Global direction detected from the following Termeh global var():

ComponentVariableTypeDefault
basedirectionltr | rtlltr

Is-Rtl

RTL-only styles. Applies styles when the global direction is right-to-left, or the element has the .is-rtl class, or matches the :dir(rtl) selector.

Signature:

scss
@mixin is-rtl();

Example:

scss
.container {
  @include termeh.is-rtl {
    text-align: right;
    margin-right: auto;
  }
}
Dependencies

Global direction detected from the following Termeh global var():

ComponentVariableTypeDefault
basedirectionltr | rtlltr

Is-Invalid

Styles for invalid state (works for elements and within .field containers).

Signature:

scss
@mixin is-invalid();

Example:

scss
.input {
  @include termeh.is-invalid {
    border-color: #e74c3c;
  }
}

Is-Disabled

Styles for disabled state (element itself or within disabled fieldset/field).

Signature:

scss
@mixin is-disabled();

Example:

scss
.button {
  @include termeh.is-disabled {
    opacity: 0.6;
  }
}

Control-Padding

Returns the standard control padding as a shorthand list.

Signature:

scss
@function control-padding(): LIST;

Example:

scss
.input {
  padding: termeh.control-padding();
}
Dependencies

Control padding is calculated from the following Termeh global var():

ComponentVariableTypeDefault
controlv-paddingNUMBER0
controlh-paddingNUMBER1.2em

Inline-Padding

Returns the standard inline element padding as a shorthand list.

Signature:

scss
@function inline-padding(): LIST;

Example:

scss
.input {
  padding: termeh.inline-padding();
}
Dependencies

Inline padding is calculated from the following Termeh global var():

ComponentVariableTypeDefault
gapmicroNUMBER8px

Transition

Applies a standard transition using theme duration and easing.

Signature:

scss
@mixin transition($fields: LIST);

Example:

scss
.button {
  @include termeh.transition(background-color, color);
}
Dependencies

UI transitions are calculated from the following Termeh global var():

ComponentVariableTypeDefault
transitioneaseeasingease
transitiondurationduration250ms

Disabled

Applies disabled theming to form controls (colors and borders).

Signature:

scss
@mixin disabled();

Example:

scss
.input[disabled],
.input.is-disabled {
  @include termeh.disabled;
}
Dependencies

The disabled style is derived from the following Termeh global var():

ComponentVariableTypeDefault
inputdisabledcolornull
inputdisabled-foregroundcolornull
inputdisabled-bordercolornull

Selection

Styles selection color pair based on a palette name (foreground & background).

Signature:

scss
@mixin selection($name: STRING);

Example:

scss
p,
.prose {
  @include termeh.selection("primary");
}

Scrollable

Provides a scrollable style with a themed scrollbar, where only the hover thumb color is applied directly.

Signature:

scss
@mixin scrollable($color: COLOR);

Example:

scss
.sidebar {
  @include termeh.scrollable(#7f8c8d);
}
Dependencies

The scrollbar style is derived from the following Termeh global var():

ComponentVariableTypeDefault
scrollsizecolor1rem
scrolltrackcolornull
scrollthumbcolornull