Border
Border-radius, border, and shadow-reset escape hatches. All classes
emit with !important so they reliably beat
component-level rules.
How it works
.is-roundedresolves at runtime viavar(--kc-border-radius, <fallback>)where the fallback mirrorsvariables.$global-border-radius. Overriding--kc-border-radiusat any scope re-tints rounded corners across the page without recompiling..is-radiusless,.is-circle, and.is-pillemit fixed values (0,50%, and$pill-radiusrespectively)..is-bordereduses a 50 %currentColormix incolor-mix(in srgb, …, transparent). This matches the form-control border treatment and clears WCAG 1.4.11 (3 : 1 non-text contrast) against either theme background — adopt it when you need a divider that adapts to the surrounding colour..is-borderlessand.is-shadowlessare pure resets: useful when a component default ships a border or shadow you want to suppress for a single instance.
Live
Radius shapes
.is-rounded
.is-pill
◐
.is-radiusless
<div style="display: flex; gap: 1rem; flex-wrap: wrap; align-items: center;">
<div class="is-rounded" style="background: var(--kc-primary-bg); color: var(--kc-primary-fg); padding: 0.6rem 1rem;">.is-rounded</div>
<div class="is-pill" style="background: var(--kc-success-bg); color: var(--kc-success-fg); padding: 0.4rem 1rem;">.is-pill</div>
<div class="is-circle" style="background: var(--kc-warning-bg); color: var(--kc-warning-fg); width: 3rem; height: 3rem; display: flex; align-items: center; justify-content: center;">◐</div>
<div class="is-radiusless" style="background: var(--kc-danger-bg); color: var(--kc-danger-fg); padding: 0.6rem 1rem;">.is-radiusless</div>
</div> @use '@adnap/krysalicss' with (
$feature-list: ('base-reset', 'base-global', 'helper-border')
); .is-bordered (50 % currentColor mix)
This block borrows half of
currentColor for its border.
<div class="is-bordered" style="padding: 0.6rem 1rem;">
This block borrows half of <code>currentColor</code> for its border.
</div> @use '@adnap/krysalicss' with (
$feature-list: ('base-reset', 'base-global', 'helper-border')
); Markup
<!-- Standard rounded corner (reads --kc-border-radius) -->
<div class="is-rounded">…</div>
<!-- Strip corner radius -->
<button class="is-radiusless">…</button>
<!-- Avatar / icon shapes -->
<img class="is-circle" src="…" alt="" />
<button class="is-pill">Filter</button>
<!-- 50% currentColor mix — clears WCAG 1.4.11 3:1 against either theme -->
<div class="is-bordered">…</div>
<!-- Strip borders or shadows added by a component default -->
<input class="is-borderless" />
<div class="is-shadowless">…</div> Class reference
| Class | Declaration |
|---|---|
.is-rounded | border-radius: var(--kc-border-radius, <global-radius>) |
.is-radiusless | border-radius: 0 |
.is-circle | border-radius: 50% |
.is-pill | border-radius: 999px |
.is-bordered | border: 1px solid color-mix(in srgb, currentColor 50%, transparent) |
.is-borderless | border: 0 |
.is-shadowless | box-shadow: none |
Variables
| Variable | Default | Notes |
|---|---|---|
$selector-prefix | '.is-' (derived from variables.$selector-prefix-is) | Prefix prepended to every border helper class (<prefix>rounded, <prefix>circle, …). Rebrands automatically if you globalise the framework-wide .is- convention. |
$border-radius-token | 'border-radius' | The custom-property name (sans the --kc- prefix) that .is-rounded reads. Override to point at a different design token. |
$pill-radius | 999px | Fixed radius used by .is-pill. Bumping to 9999px is a common preference for tighter inner curves. |
Override example
@use '@adnap/krysalicss/helper/border' with (
// Reroute the custom-property token (e.g. share with a design system):
$border-radius-token: 'radius-md',
// Or change the pill shorthand:
$pill-radius: 9999px,
);
// To change the default radius value across the framework, override the
// upstream global token instead:
@use '@adnap/krysalicss/variables/global' with (
$global-border-radius: 0.5rem,
); Tokens consumed
| Token | Used for |
|---|---|
--kc-border-radius | Runtime value of .is-rounded. Falls back to variables.$global-border-radius at compile time. Override per theme or per component to retint rounded corners without recompiling. |
.is-bordered reads currentColor rather than a --kc-* token, so its
border adapts to whatever the foreground colour resolves to in context
(per-theme, per-component, per-state).