Skip to main content
Stroke controls how surfaces separate, how states become visible, and how interactive elements communicate focus or selection. BEEQ uses stroke width tokens and semantic stroke colors so borders, dividers, outlines, and SVG strokes stay consistent across themes. BEEQ components include their default stroke treatment. Use these tokens when you customize component CSS variables, build custom surfaces around components, or need product-specific states to follow the same visual system.

What BEEQ provides

BEEQ provides a small stroke width scale and semantic stroke color variables. These are available as CSS custom properties wherever BEEQ styles are loaded. If your application uses the BEEQ Tailwind preset, the same values are also available through Tailwind border width, stroke width, border color, stroke color, and logical border utilities. Treat those utilities as a convenience layer. CSS variables are the portable contract.
BEEQ providesUse it for
Stroke width variablesBorder widths, dividers, outlines, and SVG stroke widths.
Semantic stroke color variablesTheme-aware border, divider, outline, feedback, and state colors.
Component CSS variablesScoped border customization for components that expose border variables.
Tailwind preset mappingsUtility classes when the consuming app installs the BEEQ Tailwind preset.

Stroke width scale

The stroke width scale has three values. Use the smallest value for standard separation, the medium value for selected or focused states, and the largest value only when the surface has enough size and emphasis.
TokenCSS variableTailwind keysValueCommon use
s--bq-stroke-sborder-s, stroke-s1pxDefault borders, dividers, table lines, and subtle separation.
m--bq-stroke-mborder-m, stroke-m2pxFocus, active, selected, or emphasized states.
l--bq-stroke-lborder-l, stroke-l3pxLarge emphasis surfaces or highly visible outlines.

Stroke color roles

Semantic stroke colors adapt to the active BEEQ theme. Use them instead of primitive color values so borders and outlines keep the right contrast in light and dark mode.
CSS variableRoleCommon use
--bq-stroke--primaryDefault separationCard borders, dividers, table lines, and neutral outlines.
--bq-stroke--secondaryStronger neutral separationSelected neutral states or higher emphasis borders.
--bq-stroke--tertiaryHigh-contrast neutral separationStrong outlines that still need a neutral color.
--bq-stroke--brandBrand or focus emphasisFocus rings, active states, and brand-highlighted outlines.
--bq-stroke--successPositive stateValid fields, saved states, and success feedback.
--bq-stroke--warningCaution stateWarning feedback or attention states.
--bq-stroke--dangerError stateInvalid fields, destructive states, and danger feedback.
--bq-stroke--infoInformational stateInformational borders and support messaging.
--bq-stroke--inverseInverse surfacesBorders on dark or inverted surfaces.
--bq-stroke--altAlternative low-emphasis surfacesSubtle borders on alternative backgrounds.

Stroke style and positioning

BEEQ uses solid strokes for normal borders, dividers, and outlines. Use dashed strokes only when the surface represents a placeholder, incomplete content, drop zone, or temporary target. BEEQ does not expose separate stroke-style tokens. Use CSS border-style for solid or dashed treatment, and keep the width and color tied to BEEQ tokens. Components are designed around CSS border behavior. With box-sizing: border-box, the border is included in the element size, which matches the inside stroke positioning used in design tools.

How strokes work in code

Use CSS variables directly when you build custom UI. Use component props and component CSS variables when the stroke belongs to a BEEQ component. If your project uses the BEEQ Tailwind preset, standard utilities such as border-s, border-primary, stroke-m, and stroke-brand map to the same token system. The preset also adds logical border utilities such as border-bs-s, border-be-s, border-i-s, and border-is-s for layout direction support.

Component stroke customization

Start with component APIs when a component exposes border or stroke-related props. Use component CSS variables for scoped overrides, and use ::part() only when you need to adjust exposed internal structure.

Choosing stroke

Stroke should support the role of the element and the state it communicates. Use lighter treatment for stable surfaces and stronger treatment for interaction feedback.
UseRecommended stroke
Default container or dividervar(--bq-stroke-s) with var(--bq-stroke--primary)
Hover or selected neutral statevar(--bq-stroke-s) or var(--bq-stroke-m) with a stronger semantic stroke color
Focus or active statevar(--bq-stroke-m) with var(--bq-stroke--brand)
Success, warning, danger, or info stateState color with a width that matches the component size
Placeholder, drag-and-drop, or incomplete stateDashed stroke with a semantic color
Large emphasis surfacevar(--bq-stroke-l) only when the surface has enough space and visual weight

Usage guidelines

Use --bq-stroke-s, --bq-stroke-m, and --bq-stroke-l instead of one-off pixel values. The small scale keeps borders consistent across components and custom surfaces.
Use --bq-stroke--* variables instead of primitive colors. Semantic colors adapt to the theme and communicate the role of the border.
Use s for cards, dividers, tables, and neutral containers. It creates separation without competing with content.
Use m when the border communicates interaction, selection, or keyboard focus. Pair it with a clear semantic color.
Use l only for large or high-emphasis surfaces. Thick borders can crowd compact controls and make dense UI feel heavy.
Use dashed strokes for placeholders, incomplete content, drag-and-drop targets, and upload areas. Avoid dashed borders for stable containers.
Choose stroke width together with radius and padding. A thicker border usually needs enough internal spacing to avoid a cramped layout.
Pair state borders with text, icons, labels, or ARIA where needed. Shape and color alone are not enough for every user.

Accessibility and constraints

Stroke is visual, but it affects how people find and understand interactive states.
  • Keep focus indicators visible. Use enough contrast between the focus stroke and the surrounding surface.
  • Avoid replacing browser or component focus treatment without providing an equally visible alternative.
  • Do not rely on color or stroke width alone to communicate error, warning, success, or selected states.
  • Keep borders inside the element box with box-sizing: border-box so focus and active states do not shift layout.
  • Check dense layouts at zoomed and narrow widths. Thicker strokes reduce the available content area.
  • Use semantic state colors consistently so users can learn the meaning of success, warning, danger, and focus borders.

Resources

Global CSS variables

Review the stroke width and semantic stroke color variables used by BEEQ themes.

Root token source

See the source that defines the BEEQ stroke width values.