Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@ const config = {
features: {
backgrounds: false,
},

// Vite's default target (chrome111/firefox114/safari16.4) predates
// light-dark() support, so lightningcss tries to polyfill it and breaks.
async viteFinal(viteConfig) {
viteConfig.build ??= {}
viteConfig.build.cssTarget = ['chrome123', 'edge123', 'firefox120', 'safari17.5', 'ios17.5']
return viteConfig
},
}
export default config
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@
"@storybook/addon-docs": "^10.4.6",
"@storybook/html-vite": "^10.4.6",
"cssnano": "^8.0.2",
"eslint": "^10.5.0",
"eslint": "^10.6.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-storybook": "^10.4.6",
"generate-template-files": "^3.2.1",
"globals": "^17.6.0",
"postcss": "^8.5.15",
"globals": "^17.7.0",
"postcss": "^8.5.16",
"postcss-cli": "^11.0.1",
"postcss-import": "^16.1.1",
"prettier": "^3.8.4",
"prettier": "^3.9.5",
"storybook": "^10.4.6",
"storybook-design-token": "^5.0.0",
"style-loader": "^4.0.0",
"stylelint": "^17.13.0",
"stylelint": "^17.14.0",
"stylelint-config-idiomatic-order": "^10.0.0",
"stylelint-prettier": "^5.0.3",
"stylelint-use-logical": "^2.1.3",
"vite": "^8.0.16"
"vite": "^8.1.4"
},
"peerDependencies": {
"tom-select": "^2.0.0"
Expand Down
84 changes: 63 additions & 21 deletions src/stories/Components/Sidebar/Sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,47 @@ Sidebar can be used as a standalone component, however, it does have a few depen
`.sidebar` Provides a neutral colored sidebar. This uses the neutral color defined in your theme.

<div class="flex gap-sm">
<Canvas of={SidebarStories.DefaultDrawer} />
<Canvas of={SidebarStories.DefaultCompact} />
<Canvas of={SidebarStories.DefaultRail} />
<div>
<Canvas of={SidebarStories.DefaultDrawer} />
</div>
<div>
<Canvas of={SidebarStories.DefaultCompact} />
</div>
<div>
<Canvas of={SidebarStories.DefaultRail} />
</div>
</div>

### Primary

`.sidebar--primary` Provides a primary colored sidebar. This uses the primary color defined in your theme.

<div class="flex gap-sm">
<Canvas of={SidebarStories.PrimaryDrawer} />
<Canvas of={SidebarStories.PrimaryCompact} />
<Canvas of={SidebarStories.PrimaryRail} />
<div>
<Canvas of={SidebarStories.PrimaryDrawer} />
</div>
<div>
<Canvas of={SidebarStories.PrimaryCompact} />
</div>
<div>
<Canvas of={SidebarStories.PrimaryRail} />
</div>
</div>

### Padded

`.sidebar--padded` Adds a top and bottom padding to the sidebar.

<div class="flex gap-sm">
<Canvas of={SidebarStories.PaddedDrawer} />
<Canvas of={SidebarStories.PaddedCompact} />
<Canvas of={SidebarStories.PaddedRail} />
<div>
<Canvas of={SidebarStories.PaddedDrawer} />
</div>
<div>
<Canvas of={SidebarStories.PaddedCompact} />
</div>
<div>
<Canvas of={SidebarStories.PaddedRail} />
</div>
</div>

### Brand
Expand All @@ -133,9 +151,15 @@ Sidebar can be used as a standalone component, however, it does have a few depen
The brand is not required and the sidebar content will adjust itself accordingly.

<div class="flex gap-sm">
<Canvas of={SidebarStories.NoBrandDrawer} />
<Canvas of={SidebarStories.NoBrandCompact} />
<Canvas of={SidebarStories.NoBrandRail} />
<div>
<Canvas of={SidebarStories.NoBrandDrawer} />
</div>
<div>
<Canvas of={SidebarStories.NoBrandCompact} />
</div>
<div>
<Canvas of={SidebarStories.NoBrandRail} />
</div>
</div>

### Content
Expand All @@ -145,21 +169,39 @@ The brand is not required and the sidebar content will adjust itself accordingly
`.sidebar__content--start`, `.sidebar__content--center`, `.sidebar__content--end` with start being the default.

<div class="flex gap-sm">
<Canvas of={SidebarStories.CenteredDrawer} />
<Canvas of={SidebarStories.CenteredCompact} />
<Canvas of={SidebarStories.CenteredRail} />
<div>
<Canvas of={SidebarStories.CenteredDrawer} />
</div>
<div>
<Canvas of={SidebarStories.CenteredCompact} />
</div>
<div>
<Canvas of={SidebarStories.CenteredRail} />
</div>
</div>

<div class="flex gap-sm">
<Canvas of={SidebarStories.EndDrawer} />
<Canvas of={SidebarStories.EndCompact} />
<Canvas of={SidebarStories.EndRail} />
<div>
<Canvas of={SidebarStories.EndDrawer} />
</div>
<div>
<Canvas of={SidebarStories.EndCompact} />
</div>
<div>
<Canvas of={SidebarStories.EndRail} />
</div>
</div>

<div class="flex gap-sm">
<Canvas of={SidebarStories.LogoutDrawer} />
<Canvas of={SidebarStories.LogoutCompact} />
<Canvas of={SidebarStories.LogoutRail} />
<div>
<Canvas of={SidebarStories.LogoutDrawer} />
</div>
<div>
<Canvas of={SidebarStories.LogoutCompact} />
</div>
<div>
<Canvas of={SidebarStories.LogoutRail} />
</div>
</div>

## Sidebar API
Expand Down
2 changes: 1 addition & 1 deletion src/stories/Components/Switch/Switch.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Here are the variables that can be customized:

The switch classes are structured using the [BEM methodology](https://getbem.com/naming).

This allows us to define core styles on a main [block](https://getbem.com/naming/#block) class, and use [modifiers](https://getbem.com/naming/#modifier) to encapsulate variant styles. You can modify all switch behavior by overriding the `%switch-global` selector and setting any properties:
This allows us to define core styles on a main [block](https://getbem.com/naming/#block) class, and use [modifiers](https://getbem.com/naming/#modifier) to encapsulate variant styles. You can modify all switch behavior by overriding the `.switch` selector and setting any properties:

```css
.switch {
Expand Down
27 changes: 27 additions & 0 deletions src/stories/Overview/Introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,30 @@ Add a link in your HTML head or an `@import` to the top of your root level `css`
```

Note: You can use this method to use Optics with [CodePen](https://codepen.io/). In a CodePen project, go to `Settings > CSS`, find the section for adding external stylesheets, and add the CDN link as a resource.

## Browser Support

Optics aims to follow [Baseline](https://web.dev/baseline) for browser support.

While **Widely available** — interoperable across all major browsers for 30 months is the goal, we currently sit at **Newly available** — interoperable across all major browsers for 24 months (as of July 2026).

<table>
<thead>
<tr>
<th>Chrome</th>
<th>Edge</th>
<th>Firefox</th>
<th>Safari</th>
<th>iOS Safari</th>
</tr>
</thead>
<tbody>
<tr>
<td>123</td>
<td>123</td>
<td>128</td>
<td>17.5</td>
<td>17.5</td>
</tr>
</tbody>
</table>
Loading