Skip to content

CSS: toggle-details ​

.instui-toggle-details — A styled native <details> disclosure with a rotating chevron.

Built on the native <details> element, so the browser drives open and close plus keyboard support; the CSS only hides the default marker and supplies the rotating chevron.

Source: toggle-details.css

Usage ​

css
@import "@pantoken/components/components.css";
@import "@pantoken/components/toggle-details.css";
html
-docs
<details class="instui-toggle-details -variant-filled">
  <summary>Keyboard support</summary>
  The native disclosure control supports keyboard interaction.
</details>

Structure ​

text
.instui-toggle-details
  summary
flowchart TD n0[".instui-toggle-details"]:::cssdoc-root n1("summary"):::cssdoc-part n0 --> n1 classDef cssdoc-root stroke-width:1px; classDef cssdoc-part stroke-width:1px; classDef cssdoc-slot stroke-width:1px; classDef cssdoc-component stroke-width:1px;

Modifiers ​

ModifierDescription
.-chevron-endPlace the chevron after the summary.
.-size-largeLarge. Long-form alias of -size-lg.
.-size-lgLarge.
.-size-smSmall.
.-size-smallSmall. Long-form alias of -size-sm.
.-variant-filledFilled (surface) variant.

Pseudo-elements ​

Pseudo-elementDescription
::beforeDraws the summary's disclosure chevron, a masked glyph that rotates to point down when the disclosure is open.

States ​

StateDescription
:state(open)—

Conditions ​

TypeQueryDescription
media(forced-colors: active)—
media(prefers-reduced-motion: reduce)—

Accessibility ​

With reduced motion enabled, the chevron changes direction immediately; native disclosure state and keyboard operation remain unchanged.

ConditionsRebrand (light)Rebrand (dark)CanvasCanvas High Contrast
forced-colors-focus-visibleWCAG 2.2 1.4.11, 2.4.7PassPassPassPass
reduced-motion-respectedWCAG 2.2 2.3.3, 2.2.2PassPassPassPass
reduced-transparency-respectedWCAG 2.2 1.4.3, 1.4.11PassNot applicableNot applicableNot applicable
reflow-at-320pxWCAG 2.2 1.4.10PassPassPassPass
text-spacing-no-clippingWCAG 2.2 1.4.12PassPassPassPass
InteractionsRebrand (light)Rebrand (dark)CanvasCanvas High Contrast
enter-togglesWCAG 2.2 2.1.1, 4.1.2PassPassPassPass
expanded-state-exposedWCAG 2.2 4.1.2PassPassPassPass
focus-indicator-visibleWCAG 2.2 2.4.7PassPassPassPass
no-focus-trapWCAG 2.2 2.1.2PassPassPassPass
space-togglesWCAG 2.2 2.1.1, 4.1.2PassPassPassPass
trigger-reachable-by-tabWCAG 2.2 2.1.1PassPassPassPass
Computed stylesRebrand (light)Rebrand (dark)CanvasCanvas High Contrast
focus-indicator-contrastWCAG 2.2 1.4.11, 2.4.13PassPassPassPass
text-contrast-by-stateWCAG 2.2 1.4.3PassPassPassPass
Screen reader (simulated)Rebrand (light)Rebrand (dark)CanvasCanvas High Contrast
AnnouncementsPassPassPassPass

These automated results do not establish that the page meets WCAG; manual review is still needed.

Tokens consumed ​

TokenTypeValue
--instui-color-background-interactive-action-secondary-base<color>light-dark(color-mix(in srgb, #44709F 20%, transparent), #345B84)
--instui-component-toggle-details-content-padding-large<length>1.375rem
--instui-component-toggle-details-content-padding-medium<length>1.125rem
--instui-component-toggle-details-content-padding-small<length>1.125rem
--instui-component-toggle-details-font-family[ <font-family-name> | <generic-font-family> ]#Atkinson Hyperlegible Next, "Helvetica Neue", Helvetica, Arial, sans-serif
--instui-component-toggle-details-font-size-large<length>1.25rem
--instui-component-toggle-details-font-size-medium<length>1rem
--instui-component-toggle-details-font-size-small<length>0.875rem
--instui-component-toggle-details-font-weight<integer>400
--instui-component-toggle-details-icon-margin<length>0.375rem
--instui-component-toggle-details-line-height<percentage>150%
--instui-component-toggle-details-text-color<color>LightDarklight-dark(#273540, #ffffff)
--instui-component-toggle-details-toggle-border-radius<length>0.75rem
--instui-component-toggle-details-toggle-padding<length>0.375rem
--instui-icon-chevron-right<image>url('data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22m9%2018%206-6-6-6%22%2F%3E%3C%2Fsvg%3E')
  • toggle-group — The bordered, grouped form of the same disclosure.