Search

Trait Class

Trait Classes declare a role on an element or attach a feature to it.
They belong to @layer lism-trait.

  • is--{name}: declares a role / existence (“is a …”).
  • has--{name}: attaches a feature (“has a …”).

is--* (Role declaration)

ClassDescription
is--containerDefines the reference element for container queries
is--wrapperWrapper element that controls content width
is--layerOverlay layer positioned over a parent element
is--boxLinkMakes the entire box a clickable link
is--coverLinkA link with a clickable area covering the entire parent element (→ see is--boxLink)
is--sideFor the side element of l--sideMain (→ see l--sideMain)
is--skipFlowCancels spacing with the next sibling inside l--flow (→ see l--flow)

has--* (Feature attachment)

has--transition

Sets the transition property using dedicated variables.

.has--transition {
  --duration: var(--transition-duration, 0.25s);
  --ease: ease;
  --delay: 0s;
  --transitionProps: all;
  transition: var(--duration) var(--ease) var(--delay);
  transition-property: var(--transitionProps);
}
Usage example
Example
<div class="has--transition -hov:-c" style="--transitionProps: color; --hov-c: var(--red);">Example</div>

See the hover documentation page for usage examples.

has--gutter

A class that adds predefined horizontal spacing to the left and right sides of content. It is provided as a separate class from padding utilities to reserve a consistent horizontal margin across the entire site.

Class nameSpacingDefault value
has--gutter--gutter-sizevar(--s30)
.has--gutter {
  padding-inline: var(--gutter-size);
}
Example

Lorem ipsum content…

Lorem ipsum content…

Lorem ipsum content…

Resize
<div class="has--gutter">
<p>Lorem ipsum content...</p>
<p>Lorem ipsum content...</p>
<p>Lorem ipsum content...</p>
</div>

has--snap

Allows scroll-snap- properties to be set via CSS variables.

.has--snap {
  --snapType: both mandatory;
  --snapAlign: start;
  --snapStop: normal;
  scroll-snap-type: var(--snapType);

  & > * {
    scroll-snap-align: var(--snapAlign);
    scroll-snap-stop: var(--snapStop);
  }
}
VariablePurposeDefault
--snapTypeValue for scroll-snap-typeboth mandatory
--snapAlignValue for child scroll-snap-alignstart
--snapStopValue for child scroll-snap-stopnormal

has--mask

Applies a mask to the element itself in combination with the --maskImg variable.

.has--mask {
  --maskPos: 50%;
  --maskSize: contain;
  --maskRepeat: no-repeat;
  mask: var(--maskImg) var(--maskRepeat) var(--maskPos) / var(--maskSize);
}
VariablePurposeDefault
--maskImgMask image (SVG, etc.)
--maskPosMask position50%
--maskSizeMask sizecontain
--maskRepeatMask repeatno-repeat

In Lism components, use hasMask together with css={{ '--maskImg': getSvgUrl(svgString) }}.

Example
<Media
src="https://cdn.lism-css.com/img/u-2.jpg"
width="960"
height="640"
alt=""
loading="lazy"
ar="og"
hasMask
css={{ '--maskImg': getSvgUrl(`<svg ...>...</svg>`) }}
/>

© Lism CSS. All rights reserved.