Skip to content

Theming & CSS ​

Your slides are your HTML: style them with your own CSS, nothing to override. The slider's own controls (arrows, dots, pagination, autoplay button) live in a shadow root and are themed with custom properties and ::part().

html
<style>
  /* Theme from outside: custom properties and ::part() reach into the slider. */
  .brand {
    --ins-radius: 20px;
    --ins-arrow-bg: #121210;
    --ins-arrow-fg: #f3f1ec;
    --ins-dot-active: #c9a35b;
    --ins-accent: #c9a35b;
    --ins-focus: #c9a35b;
  }
  .brand::part(arrow) { border-radius: 12px; }
</style>
<insigne-slider class="brand" height="260" arrows="visible" pagination="dots" autoplay="4000">
  <div><img data-bg src="https://picsum.photos/id/1018/1200/600" alt=""></div>
  <div><img data-bg src="https://picsum.photos/id/1036/1200/600" alt=""></div>
  <div><img data-bg src="https://picsum.photos/id/1043/1200/600" alt=""></div>
</insigne-slider>
Loading preview…
Live previewEdit in playground →

Custom properties ​

Set them on the slider element (or any ancestor).

PropertyDefaultAffects
--ins-radius0Corner radius of the viewport
--ins-arrow-bgrgba(255,255,255,.88)Arrow background
--ins-arrow-fg#14161cArrow icon
--ins-pag-fgcurrentColorPagination outside the slides
--ins-dot-activecurrentColor / #fff insideActive dot
--ins-accentcurrentColor / #fff insideProgress bar, autoplay ring
--ins-focus#4f7cffKeyboard focus ring
--ins-dur, --ins-ease, --ins-ease-out360ms, …Control transitions

The pagination outside the slides uses the text color of the page (currentColor), so it follows your light / dark theme automatically.

Parts ​

PartElement
viewportThe area the slides move in
arrow, prev, nextArrow buttons
barThe row holding pagination and the autoplay button
paginationDots / fraction / progress container
dot, dot-activeIndividual dots
autoplayPause / play button
css
.my-slider::part(arrow) { border-radius: 10px; backdrop-filter: none; }
.my-slider::part(dot-active) { transform: scale(1.2); }

Classes on your slides ​

The slider adds state classes to your slides, useful for your own transitions:

ClassWhen
.ins-slideEvery slide
.is-active, .is-prev, .is-nextRelative to the current slide
.has-bgThe slide has a data-bg background
.is-thumb-activeThumbnail of the main slider's current slide

On the slider element: [data-ins-ready] once started, [data-ins-motion] while the layer engine is active.

Insigne Slider v1.0.0 · Free for any use with visible attribution · Atıf ile her kullanım için ücretsiz