Skip to content

SCSS API

To keep the CSS file size as small as possible, many of the existing variables act as opt-ins for the CSS rule(s) behind them.

In addition, a few variables set the initial value for the associated CSS variables. This way they don’t have to be overwritten in the project.

Default: 'c-breadcrumbs'

Type: string

Defines the basic BEM class.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$bem-root: "c-breadcrumbs"
);

Default: 'wrap'

Type: 'wrap' | 'ellipsis'

Opt-in CSS Rule(s): Yes

Throws: @error if the value is not 'wrap' or 'ellipsis'

Select the behavior when the breadcrumbs become larger than the display area.

Wrap lets elements that are too large for the area move to the next line.

Ellipsis displays all breadcrumbs in a single line, no matter how wide the component gets. As the name implies, text-overflow: ellipsis; is used here.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$overflow-behavior: "wrap"
);

Default: 1rem

Depends on the value of $overflow-behavior. If $overflow-behavior is set to 'wrap', this variable sets the horizontal spacing between the breadcrumbs.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$overflow-wrap-horizontal-spacing: 10px
);

Default: inherit

Initial value for --color-link-breadcrumbs.

Defines the color rule for c-breadcrumbs__link.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$color-link: red
);

Default: null

Opt-in CSS Rule(s): Yes

Sets the link color hover styles. If not set $transition-link-breadcrumbs has no effect.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$color-hover-link: blue
);

Default: null

Opt-in CSS Rule(s): Yes

Sets the color of the separator.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$color-separator: green
);

Default: null

Opt-in CSS Rule(s): Yes

Sets the color of the current breadcrumb.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$color-is-current: green
);

Default: null

Opt-in CSS Rule(s): Yes

Sets the color of the index breadcrumb.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$color-is-index: green
);

Default: 1rem

Initial value for --size-font-breadcrumbs.

Sets the font size of the breadcrumbs.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$size-font: 12px
);

Default: 6px

Initial value for --spacing-vertical-separator-breadcrumbs.

Controls the vertical spacing of the separator.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$spacing-vertical-separator: 3px
);

Default: true

Opt-in CSS Rule(s): Yes

Will set the max size of the icons to the same size as the font.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$icons-not-bigger-than-font-size: false
);

Default: color 0.2s ease-in-out

Sets the transition for the link color. If $color-hover-link is not set, this variable has no effect.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$transition-link-breadcrumbs: all 0.3s ease
);

Default: false

If true, truncated styles will be applied to the breadcrumbs.

Usage:

@use "astro-breadcrumbs/breadcrumbs.scss" with (
$truncated: true
);