---
url: /docs/about.md
---
# About
Winduum is a mix of words **Tailwind** *(Popular CSS utility framework)* and **Tuum** *(Estonian word for "core")*.
It essentially provides ways to leverage use of **modern and accessible standards** as much possible. Because we ❤️ CSS and this is a small modest CSS component framework.
Its approach to **TailwindCSS** is a little different.
It encourages writing components in CSS or other
(pre/post)-processors and to use utility classes to enhance the components.
As a CSS library, it provides beautifully styled accessible components. Which you can extend with your own components.
It is very modular and split to `base`, `components` and `utilities` layers.
You can choose what you want to use and make your own complex UX/UI project written in whatever you want.
## Why?
The question inevitably arises: Why introduce yet another UI component library into the mix? Simply because Winduum is different in a few areas than the others.
1. It focuses on web standards, accessibility and minimum simple code
2. It's progressive, uses modern features and standards
3. It's framework-agnostic, so it can be used in any scenario
4. Its source code is plain CSS and JS, so it can be also used without a build step
## Framework-agnostic
Winduum is **framework-agnostic**, so you are able to create your own components using your preferred framework. Javascript primitives can be also adapted in any framework.
If there is interest, pre-built components may be developed for popular frameworks.
Currently,
only [`winduum-vue`](https://www.github.com/winduum/winduum-vue) and [`winduum-react`](https://www.github.com/winduum/winduum-react) are available
and most of the components have usage and installation examples in the docs.
Want to help? We're open for pull requests!
## Modern CSS Features
Staying ahead of the curve, Winduum leverages modern CSS features, allowing you to harness the power of the latest specifications and improve overall styling capabilities. All of these are supported in current browsers.
* **CSS Properties**
* **CSS Logical Properties**
* **CSS Nesting**
* **CSS color-mix**
* **Modern pseudo selectors** such as `:where`, `:is` and `:has`
* **Modern CSS reset**
* **View Transition API, Dialog API, Popover API** and more!
* **Low specifity or layers**
**Winduum** is all about accessibility and web standards that can be used in any framework.
## Naming
In your projects it's recommended to prefix component classes for better clarity. Some of these are already used for various components.
* **Component** - `x-name` (with prefix, every component is prefixed)
* **Utilities** - `name` (without prefix, utility classes for common styles)
## CSS Properties
Each CSS property follows the same naming, for example `--x-name-font-size`
## Directory structure
To help navigate your project easily,
it's recommended to follow the same naming principles for your directory structure, for example, like this:
* 📁 **base**
* 📁 **components**
* 📁 **theme**
* 📁 **utilities** or **utils**
## Examples
### Using the components
You can use any of the components easily in HTML without the need to write complex TailwindCSS classes.
Each component is written with low specificity in mind, so any property can be easily enhanced with TailwindCSS utility classes.
::: code-group
```html
```
```css
.x-button {
--x-button-font-size: 0.875rem;
/* CSS styles */
}
```
:::
### Writing the components
You can write your own components using the same approach
::: code-group
```html
Hello world
```
```css
.x-hello-world {
--x-hello-world-font-size: 2rem;
/* CSS styles */
}
```
:::
It's recommended to use TailwindCSS utility classes for most cases. If you want to style some elements in CSS inside the component, consider creating a new component.
If you don't want to create a new component, don't use complex conventions like BEM.
It's recommended
to use something like [part](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/part) attribute.
For example `data-part="body"`
```css
.x-hello-world {
:where([data-part~"body"]) {
/* CSS styles */
}
}
```
This way you can tell that it's an element related to the parent component.
In rare cases you want to prevent possible class conflicts you can add name of the component inside the class like this `x-hello-world:body`.
---
---
url: /docs/utilities/accent.md
---
# Accent
Provides a new TailwindCSS utility class `accent` which extends [Accent](https://tailwindcss.com/docs/accent) utility classe.
## TailwindCSS v4
Include CSS file with the `@utility` at-rule.
```css
@import "winduum/tailwindcss/utilities/accent.css";
```
## TailwindCSS v3
Add plugin via the `tailwind.config.js`, see [Config](/docs/base/config#tailwind-css-v3) for more info.
## Example
```html
```
---
---
url: /docs/utilities/animation.md
---
# Animation
Provides a new utility class `animation` and TailwindCSS utility class `animation-*` for `animation-name` property.
You should use this together with [Keyframes](/docs/base/keyframes) or use your own animation keyframes.
### Dependencies
* [tailwindcss](https://tailwindcss.com/) (TailwindCSS v4 @utility)
* [winduum](/docs/base/config.html#tailwind-css-v3) (TailwindCSS v3 plugin)
## TailwindCSS v4
You can add more via the `@theme` at-rule, see [Config](/docs/base/config#tailwind-css-v4) for more info.
Include CSS file with the `@utility` at-rule.
```css
@import "winduum/tailwindcss/utilities/animation.css";
```
### Example
```css
@theme {
--animation-fade-in: fade-in;
}
```
```html
Content
```
```css
.animation {
animation-duration: var(--default-animation-duration, var(--default-transition-duration));
animation-fill-mode: both;
}
.animation-fade-in {
animation-name: var(--animation-fade-in);
}
```
or use arbitrary value
```html
Content
```
```css
.animation {
animation-duration: var(--default-animation-duration, var(--default-transition-duration));
animation-fill-mode: both;
}
.animation-fade-in {
animation-name: fade-in;
}
```
## TailwindCSS v3
You can add more via the `tailwind.config.js`, see [Config](/docs/base/config#tailwind-css-v3) for more info.
### Example
```html
```
### Custom
```css
.x-badge {
--x-badge-block-size: 1rem;
--x-badge-padding-block: 0;
--x-badge-padding-inline: 1rem;
--x-badge-border-radius: 0;
--x-badge-font-size: 0.75rem;
--x-badge-font-weight: 700;
--x-badge-background-color: yellow;
--x-badge-color: #333;
}
```
You can also extend the badge with any TailwindCSS class to customize it
```html
```
### Group
You can group badges into groups via `x-group` component.
```html
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
Badge
npm
7.1.2
```
---
---
url: /docs/components/breadcrumb.md
---
# Breadcrumb
### Usage
```css
@import "winduum/src/components/breadcrumb/index.css" layer(utilities);
```
### Variants
### Props
### Installation
Follow instructions for individual framework usage below
## Example
```html
```
---
---
url: /docs/base/breakpoints.md
---
# Breakpoints
Breakpoints in Winduum are very close to TailwindCSS, yet they have slightly different values and extended to cover all possible resolutions.
You can use the same principles as defined in [Responsive design](https://tailwindcss.com/docs/responsive-design)
* **xs** - 360px
* **sm** - 416px
* **md** - 744px
* **lg** - 960px
* **xl** - 1216px
* **2xl** - 1312px
* **3xl** - 1408px
* **4xl** - 1600px
* **xxl** - 2016px
* **2xxl** - 2528px
Breakpoints are defined in [`src/base/breakpoints.css`](https://github.com/winduum/winduum/blob/main/src/base/breakpoints.css) and in [config#screens](/docs/base/config#screens)
(TailwindCSS `v3`)
or [`tailwindcss/theme/config/breakpoint.css`](https://github.com/winduum/winduum/blob/main/tailwindcss/theme/config/breakpoint.css)
(TailwindCSS `v4`)
You can also use the breakpoints inside CSS like this.
```postcss
@media (--media-md) {
/* > 768 */
}
@media not all and (--media-md) {
/* < 768 */
}
```
[Custom Media Specification](https://www.w3.org/TR/mediaqueries-5/#at-ruledef-custom-media) is used, so PostCSS or LightningCSS is required, see [Install](/docs/) for more info.
---
---
url: /docs/components/button.md
---
# Button
### Usage
```css
@import "winduum/src/components/button/index.css" layer(utilities);
```
### Variants
### Props
### Tokens
* `bordered`
* `muted`
* `raised`
* `ghosted`
* `sm`
* `lg`
* `square`
* `circle`
* `fill`
### Installation
Follow instructions for individual framework usage below
## Examples
### Basic
```html \[html]
```
```vue
```
```jsx
import { Button } from "@/components/button"
export function Example() {
return (
<>
>
)
}
```
:::
### Flat
```html
```
### Bordered
```html
```
### Muted
```html
```
### Raised
```html
```
### Ghosted
```html
```
### Small
```html
```
### Large
```html
```
### Square
```html
```
### Circle
```html
```
### Icon
```html
```
### Loading
```html
```
### Active
```html
```
### Disabled
```html
```
### Custom
```html
```
```css
.x-custom {
--color-accent: yellow;
--color-accent-foreground: #333;
--x-button-block-size: 4rem;
--x-button-padding-block: 1rem;
--x-button-padding-inline: 1rem;
--x-button-border-radius: 0;
--x-button-font-size: 1.15rem;
--x-button-font-weight: 700;
--x-button-hover-opacity: 40%;
--x-button-focus-opacity: 80%;
}
```
You can also extend the button with any TailwindCSS class to customize it
```html
```
### Group
You can group buttons into groups via `x-group` component.
```html
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla accumsan, elit sit amet varius semper, nulla mauris mollis quam, tempor suscipit diam nulla vel leo. Lorem ipsum dolor sit amet
```
### Image
```html
Card title
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nulla accumsan, elit sit amet varius semper, nulla mauris mollis quam, tempor suscipit diam nulla vel leo. Lorem ipsum dolor sit amet
```
---
---
url: /docs/components/carousel.md
---
# Carousel
Provides a scroll carousel that uses native CSS `scroll-snap` property.
### Usage
::: code-group
```css
@import "winduum/src/components/carousel/index.css" layer(utilities);
```
```liquid \[js]
```
### Variants
### Installation
Follow instructions for individual framework usage below
## Examples
### Basic
```liquid \[js]
```
### Full
```liquid \[js]
```
## Javascript API
### `scrollTo`
* **Type:** `(element: HTMLElement | Element, index: number) => void`
* **Kind:** `sync`
Scroll to a snap item by its index.
### `scrollNext`
* **Type:** `(element: HTMLElement | Element) => void`
* **Kind:** `sync`
Scroll to the next snap item.
### `scrollPrev`
* **Type:** `(element: HTMLElement | Element) => void`
* **Kind:** `sync`
Scroll to a previous snap item.
### `getItemCount`
* **Type:** `(element: HTMLElement | Element, scrollWidth: number, mathFloor: boolean) => number`
* **Kind:** `sync`
Get the number of possible scrolls inside the carousel.
### `observeCarousel`
* **Type:** `(element: HTMLElement | Element, options?: ObserveCarouselOptions) => void`
* **Kind:** `sync`
Adds an observer for the carousel. Adds properties `_observer` and `_activeIndex` to the DOM of the carousel `element`.
#### ObserveCarouselOptions
***
##### visibleAttribute
* **Type:** `string`
* **Default:** `data-visible`
A class that is added to the carousel items once they are visible.
***
##### observerOptions
* **Type:** `IntersectionObserverInit`
* **Default:** `{ threshold: 0.5 }`
Additional [options](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver/IntersectionObserver#options) confugration for the observer.
***
### `dragCarousel`
* **Type:** `(element: HTMLElement | Element, options?: DragCarouselOptions) => void`
* **Kind:** `sync`
Adds a mouse dragging capability to the carousel.
#### DragCarouselOptions
***
##### activeAttribute
* **Type:** `string`
* **Default:** `data-grabbing`
***
### `paginationCarousel`
* **Type:** `(element: HTMLElement | Element, options?: PaginationCarouselOptions) => void`
* **Kind:** `sync`
Inserts pagination indicators for the carousel to the desired element.
#### PaginationCarouselOptions
***
##### element
* **Type:** `HTMLElement | Element`
* **Default:** `undefined`
***
##### itemContent
* **Type:** `string`
* **Default:** ``
***
##### activeAttribute
* **Type:** `string`
* **Default:** `data-active`
***
### `autoplayCarousel`
* **Type:** `(element: HTMLElement | Element, options?: AutoplayCarouselOptions) => void`
* **Kind:** `sync`
Adds an autoplay for the carousel.
#### AutoplayCarouselOptions
***
##### delay
* **Type:** `number`
* **Default:** `4000`
Delay in ms.
***
##### pauseElements
* **Type:** `HTMLElement[] | Element[]`
* **Default:** `[]`
Which elements should pause the autoplay upon hover.
***
### `scrollCarousel`
* **Type:** `(element: HTMLElement | Element, options?: ScrollCarouselOptions) => void`
* **Kind:** `sync`
A helper function that updates various carousel states upon scroll.
#### ScrollCarouselOptions
***
##### observe
* **Type:** `ObserveCarouselOptions`
* **Default:** `undefined`
***
##### pagination
* **Type:** `PaginationCarouselOptions`
* **Default:** `{ activeClass: 'active' }`
***
##### progressElement
* **Type:** `HTMLProgressElement | Element`
* **Default:** `undefined`
***
##### counterMinElement
* **Type:** `HTMLElement | Element`
* **Default:** `undefined`
***
##### counterMaxElement
* **Type:** `HTMLElement | Element`
* **Default:** `undefined`
---
---
url: /docs/components/check.md
---
# Check
Check supports `checkbox` and `radio` **input** types
### Usage
```css
@import "winduum/src/components/check/index.css" layer(utilities);
```
### Variants
### Props
### Installation
Follow instructions for individual framework usage below
## Examples
### Basic
```html \[html]
```
```vue
Radio
```
```jsx
import { UiCheck } from "@/components/check"
export function Example() {
return (
<>
Radio
>
)
}
```
:::
### Label
```html
```
```html
```
### Required
```html
```
```html
```
### Disabled
```html
Checkbox
```
```html
Radio
```
### Validation
```html
```
```html
```
---
---
url: /docs/components/color.md
---
# Color
Color supports `checkbox` and `radio` **input** types for displaying selected color.
### Usage
```css
@import "winduum/src/components/color/index.css" layer(utilities);
```
### Variants
### Props
### Installation
Follow instructions for individual framework usage below
## Examples
### Basic
```html \[html]
```
```vue
```
```jsx
import { Color } from "@/components/color"
export function Example() {
return (
<>
>
)
}
```
:::
### Disabled
```html
```
---
---
url: /docs/colors.md
---
# Colors
There are few types of colors with various areas of use. Colors are defined in [Theme](/docs/base/theme).
## Common
## Main
## Body
## State
## Foreground
Each color has also it's foreground variant with `-foreground` postfix. So you can use foreground colors when needed, eg. `--color-primary-foreground`.
## Accent
The idea is that you should be able to set accent color via `accent-color` CSS property.
It is [discussed](https://github.com/w3c/csswg-drafts/issues/5900)
that you should have access to the color value of this property,
e.g. via `AccentColor` or `AccentColorText`.
Most of the components are using this idea via `--color-accent` and `--color-accent-foreground` as an alternative for their accent color.
```html
```
For example, this way you don't have to change background-color property for each component color variant, you just change the accent color.
---
---
url: /docs/components/compare.md
---
# Compare
Side-by-side comparison slider component.
### Usage
```css
@import "winduum/src/components/compare/index.css" layer(utilities);
```
### Variants
### Installation
Follow instructions for individual framework usage below
## Examples
### Default
```liquid \[js]
```
### Text
```liquid \[js]
```
## Javascript API
### setPosition
* **Type:** `(element: HTMLInputElement, options?: SetPositionOptions) => void`
* **Kind:** `sync`
#### SetPositionOptions
***
##### selector
* **Type:** `string`
* **Default:** `.x-compare`
***
##### positionProperty
* **Type:** `string`
* **Default:** `--x-compare-position`
***
### setKeyboardStep
* **Type:** `(element: HTMLInputElement, key: string, step?: number) => void`
* **Kind:** `sync`
### setMouseStep
* **Type:** `(element: HTMLInputElement, step?: number) => void`
* **Kind:** `sync`
---
---
url: /docs/utilities/container.md
---
# Container
Provides a new approach to classic [Container](https://tailwindcss.com/docs/container) with a new utility class `grid-cols-container` which utilizes `grid` and is inspired by [Kevin Powell](https://youtu.be/c13gpBrnGEw?si=FGoMS9FnWEOYohPi).
```css
.grid-cols-container {
grid-template-columns:
[container-full-start] minmax(var(--container-padding), 1fr)
[container-breakout-start] minmax(0, calc((var(--container-breakout-width) - var(--container-width)) / 2))
[container-start] min(100% - (var(--container-padding) * 2), var(--container-width)) [container-end]
minmax(0, calc((var(--container-breakout-width) - var(--container-width)) / 2)) [container-breakout-end]
minmax(var(--container-padding), 1fr) [container-full-end];
& > :where(*) {
grid-column: container;
}
}
```
## Example
Easy layout with `grid`
```html
Header Full WidthContent in container
```
In same cases classic approach is still handy, you can achieve that easily with `w`
```html
Content
```
---
---
url: /docs/components/control.md
---
# Control
Form control as it should be!
This component supports **input**, **select** and **textarea** including **all** [input types](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input)
* `text`, `color`, `date`, `datetime-local`, `email`, `file`, `hidden`, `month`, `number`, `password`, `search`, `tel`, `time`, `url`, `week`
Other input types are supported in other components
* `checkbox`, `radio` - included in [Check](/docs/components/check), [Switch](/docs/components/switch), [Color](/docs/components/color) or [Rating](/docs/components/rating)
* `range` - included in [Range](/docs/components/range)
* `button`, `reset`, `submit` - included in [Button](/docs/components/button)
### Installation
Follow instructions for individual framework usage below
### Usage
```css
@import "winduum/src/components/control/index.css" layer(utilities);
```
### Variants
### Props
## Examples
### Basic
```html \[html]
```
```vue
```
```jsx
import { Control } from "@/components/control"
export function Example() {
return (
<>
>
)
}
```
:::
### Icon
You can position any content to `start` and `end` of the control.Padding is automatically handled by CSS up to two icons, or you can do it manually.
* `--x-control-icon-count-start` - number of icons at the start of the control
* `--x-control-icon-count-end`- number of icons at the end of the control
* `--x-control-start` - manually change start padding in px according to content
* `--x-control-end` - manually change end padding in px according to content
```html
```
### Group
You can group controls into groups via `x-group` component and combine them with other components like [Button](/docs/components/button)
```html
@
```
---
---
url: /docs/base/config.md
---
# CSS config
Each CSS property is defined in CSS in following path - [`src/theme/config/index.css`](https://github.com/winduum/winduum/blob/main/src/theme/config/index.css).
We are using naming conventions from TailwindCSS `v4`,
so you can use these properties in both current and future versions of TailwindCSS or without TailwindCSS.
```css
@import "./font.css";
@import "./radius.css";
@import "./spacing.css";
@import "./transition.css";
@import "./z.css";
```
## Tailwind CSS v4
In the new version of TailwindCSS the configuration is done via CSS, so no plugin is necessary.
Most of the config CSS properties are also part of the new version.
```css
@import "tailwindcss/theme.css" layer(theme);
@import "winduum/tailwindcss/theme/config/index.css" layer(theme);
@import "winduum/tailwindcss/theme/default.css" layer(theme);
```
## Tailwind CSS v3
To add `winduum` to TailwindCSS v3, add folowing plugin to `tailwind.config.js` configuration file.
```js
import winduum from 'winduum'
export default {
darkMode: 'class',
content: [
'./node_modules/winduum/src/**/*.js',
'./src/**/*.{js,html}'
],
plugins: [
winduum({
// config options
})
],
}
```
You can customize config with options listed bellow.
This plugin disables by default following TailwindCSS corePlugins
* **preflight** - custom modern css reset is used, see [Reset](/docs/base/reset)
Winduum also exports useful helper functions you can use in your `tailwind.config.js`, see [`utils/tailwind.js`](https://github.com/winduum/winduum/blob/main/utils/tailwind.js) for more info.
### settings.rgb
Include `-rgb` color variants. Learn more about this in [Compatibility](/docs/base/theme.html#compatibility) section.
* **Type:** `boolean`
* **Default:** `false`
### settings.colorMix
Use `color-mix` in color variants instead of rgb. Learn more about this in [Compatibility](/docs/base/theme.html#compatibility) section.
* **Type:** `boolean`
* **Default:** `true`
### colors
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional color tokens that can be used with TailwindCSS as CSS custom properties, which can be then defined in `.css`. See [Colors](/docs/colors) for more info.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `bg-primary`:
```css
.bg-primary {
background-color: color-mix(in sRGB, var(--color-primary) calc(var(--tw-bg-opacity, 1) * 100%), transparent);
}
```
### fontFamily
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional font-family tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `font-primary`:
```css
.font-primary {
font-family: var(--font-primary);
}
```
### fontWeight
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional font-weight tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `font-bold`:
```css
.font-bold {
font-weight: var(--font-bold);
}
```
### ease
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional transition easing tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `ease-linear`:
```css
.ease-linear {
transition-timing-function: var(--ease-linear);
}
```
### zIndex
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional z-index tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `z-10`:
```css
.z-10 {
z-index: var(--z-10);
}
```
### fontSize
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional `font-size` tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `text-md`:
```css
.text-md {
font-size: var(--font-size-md);
line-height: calc(var(--font-size-md) + 0.5rem);
}
```
### spacing
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional spacing tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `gap-4`:
```css
.gap-4 {
gap: var(--spacing-4);
}
```
Example `px-4`:
```css
.px-4 {
padding-left: var(--spacing-4);
padding-right: var(--spacing-4);
}
```
### borderRadius
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional border-radius tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `rounded-md`:
```css
.rounded-md {
border-radius: var(--radius-md);
}
```
### animations
* **Type:** `string[]`
* **Default:** `['fade-in', 'fade-out', 'ripple', 'spin', 'move-indeterminate']`
These are additional animation tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `animation-fade-in`:
```css
.animation-fade-in {
animation-name: fade-in;
}
```
### mask
* **Type:** `string[] | string`
* **Default:** `undefined`
These are additional mask tokens that can be used with TailwindCSS as CSS properties, which can be then defined in `.css`.
Or you can add a path to `.css` file containing the CSS custom properties, and it will be parsed automatically.
Example `animation-fade-in`:
```css
.mask-check {
mask: var(--mask-check)
}
```
### screens
* **Type:** `object`
* **Default:**
```js
{
'xs': '22.5em',
'sm': '26em',
'md': '48em',
'lg': '60em',
'xl': '76em',
'2xl': '82em',
'3xl': '88em',
'4xl': '100em',
'xxl': '126em',
'2xxl': '158em'
}
```
These are new media queries tokens that can be used with TailwindCSS, see more in [Breakpoints](/docs/base/breakpoints)
---
---
url: /docs/base/defaults.md
---
# Defaults
Default styles or rules applied to certain HTML elements or pseudo-elements. These are very much optional.
[`src/base/defaults.css`](https://github.com/winduum/winduum/blob/main/src/base/defaults.css)
```css
::selection {
color: var(--color-primary-foreground);
background-color: var(--color-primary);
}
:where([tabindex]) {
outline: 0;
}
:where(button),
:where([type="checkbox"]),
:where([type="radio"]),
:where([role="button"]),
:where(summary) {
touch-action: manipulation;
user-select: none;
}
:where(button:enabled),
:where([type="checkbox"]:enabled),
:where([type="radio"]:enabled),
:where([role="button"]:not([aria-disabled="true"])),
:where(summary) {
cursor: var(--cursor-pointer, pointer);
}
:where(svg:not([width])) {
width: 1.25rem;
}
:where(svg:not([height])) {
height: 1.25rem;
}
:where(hr) {
background-color: color-mix(in var(--default-color-space), currentcolor 100%, transparent);
block-size: 1px;
inline-size: 100%;
}
:where(code) {
padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
background-color: var(--color-body-secondary);
border-radius: var(--radius-sm);
color: var(--color-accent);
}
:where(kbd) {
padding: calc(var(--spacing) * 1) calc(var(--spacing) * 2);
background: var(--color-body-secondary);
border-radius: var(--radius-sm);
border: 1px solid var(--color-body-tertiary);
}
:where(html) {
color-scheme: var(--default-color-scheme);
font-family: var(--font-primary);
font-weight: var(--font-weight-normal);
block-size: 100%;
line-height: 1.5;
text-size-adjust: 100%;
@media (prefers-reduced-motion: no-preference) {
scroll-behavior: smooth;
}
}
:where(body) {
min-block-size: 100%;
background-color: var(--color-body);
color: var(--color-main);
accent-color: var(--color-accent);
}
[hidden] {
display: none !important;
}
```
For TailwindCSS `v3` there are few rules such as resetting borders
and applying `--tw-content` to all pseudo-elements and zero border to all elements or pseudo-elements.
[`tailwindcss/base/defaults.css`](https://github.com/winduum/winduum/blob/main/tailwindcss/base/defaults.css)
## Cursor
Default `cursor: pointer` for clickable elements, you can change this globally via CSS property `--default-cursor` if you prefer more application like behavior.
## Svg
Set the default size of an SVG as a small square if neither width nor height is specified.
```html
```
## Hr
Just a horizontal rule.
```html
```
## Code
```html
Cool code
```
## Kbd
```html
Ctrl+C/⌘+C
```
## Html & Body
Basic text and color properties
---
---
url: /docs/components/details.md
---
# Details
An accessible accordion or toggle component for `details` and `summary` elements.
Uses small external library `slide-element` for smooth toggle animations.
It is unstyled by default, so you can apply your own styles.
### Dependencies
* [slide-element](https://www.npmjs.com/package/slide-element)
### Usage
::: code-group
```shell
npm i slide-element
```
```html
Show more
Details content
```
```js
import { toggleDetails } from 'winduum/src/components/details'
document.querySelectorAll('[data-action="toggleDetails"]').forEach(summary => {
summary.addEventListener('click', event => {
if (event.currentTarget.tagName !== 'INPUT') event.preventDefault()
toggleDetails(summary)
})
})
```
:::
### Installation
Follow instructions for individual framework usage below
## Examples
### Default
```liquid \[js]
```
### Checkbox
```liquid \[js]
```
### Accordion
```liquid \[js]
```
## Javascript API
```typescript
interface DefaultOptions {
selector?: string
summarySelector?: string
}
```
### toggleDetails
* **Type:** `(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions) => Promise`
* **Kind:** `async`
Toggles a details element, should be added on summary or anywhere inside the details element.
### showDetails
* **Type:** `(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions) => Promise`
* **Kind:** `async`
Shows a details element, should be added on `summary` or anywhere inside the `details` element.
### closeDetails
* **Type:** `(selector: HTMLInputElement | HTMLElement, options?: DefaultOptions) => Promise`
* **Kind:** `async`
Closes a details element, should be added on `summary` or anywhere inside the `details` element.
---
---
url: /docs/components/dialog.md
---
# Dialog
Modal component that uses native HTML5 `dialog` functionality.
## Usage
::: code-group
```css
@import "winduum/src/components/dialog/index.css" layer(utilities);
```
```js
import { showDialog } from 'winduum/src/components/dialog'
document.querySelector('#showDialog').addEventListener('click', () => {
showDialog(document.querySelector('dialog'))
})
```
```vue
Open Dialog
```
:::
### Variants
### Props
### Installation
Follow instructions for individual framework usage below
## Example
::: code-group
```html
```
```vue
Open Dialog
```
:::
## JavaScript API
### `showDialog`
* **Type:** `(selector: HTMLDialogElement, options?: DefaultOptions) => Promise`
* **Kind:** `async`
Shows an existing `