Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
d1273e9
implemented theme functionality in six-root. colors are not yet pretty
stefan-laux Nov 13, 2025
12bda69
update changelog.md
stefan-laux Nov 13, 2025
523c08b
update colors in components
stefan-laux Nov 13, 2025
2398570
update colors for input
Nov 13, 2025
019ac1b
six details colors adjusted
stefan-laux Nov 13, 2025
a7d6ec8
six xxx colors adjusted and variables updated
stefan-laux Nov 13, 2025
a81ed40
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 13, 2025
ea8c1b6
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
b85e5a5
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
2152cc9
fix background color in dark mode
Nov 14, 2025
85977ef
Merge remote-tracking branch 'origin/feature/theme-support' into feat…
stefan-laux Nov 14, 2025
6a19409
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
cee2693
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
785602b
update colors for tile and timepicker
Nov 14, 2025
169e736
update colors for tab
Nov 14, 2025
c76c252
update colors for input
davidemarcoli Nov 14, 2025
6beb9ae
six details colors adjusted
stefan-laux Nov 13, 2025
e34a78d
six xxx colors adjusted and variables updated
stefan-laux Nov 13, 2025
388ad2b
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 13, 2025
d3e55df
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
418a512
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
64d30f1
fix background color in dark mode
davidemarcoli Nov 14, 2025
2efad97
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
4856acd
six various component colors adjusted and variables updated / extracted
stefan-laux Nov 14, 2025
8b09353
update colors for tile and timepicker
davidemarcoli Nov 14, 2025
8854a99
update colors for tab
davidemarcoli Nov 14, 2025
f08aa11
update colors for the browser scrollbars
davidemarcoli Nov 14, 2025
044bfe8
fix ci build
davidemarcoli Nov 14, 2025
d47b324
implemented six theme switcher (a component used to switch between th…
stefan-laux Nov 14, 2025
c837241
fix six-range test
davidemarcoli Nov 14, 2025
075c6fb
Merge remote-tracking branch 'origin/feature/theme-support' into feat…
stefan-laux Nov 14, 2025
b483ced
Merge remote-tracking branch 'origin/feature/theme-support' into feat…
stefan-laux Nov 14, 2025
d724f62
remove h3 in root example
stefan-laux Nov 14, 2025
7dffa74
fix six-theme-switcher test
davidemarcoli Nov 14, 2025
0df9e57
example app changes
stefan-laux Nov 14, 2025
5761c96
fix vitepress styles and dark mode enabled to see components in dark …
stefan-laux Nov 17, 2025
4419aff
fix vitepress styles and dark mode enabled to see components in dark …
stefan-laux Nov 17, 2025
64a969e
remove unused css files
stefan-laux Nov 17, 2025
3495fd9
Merge branch 'main' into feature/theme-support
stefan-laux Nov 19, 2025
6a2cada
update color docs
stefan-laux Nov 20, 2025
22c5e9e
Merge remote-tracking branch 'origin/feature/theme-support' into feat…
stefan-laux Nov 20, 2025
39b2649
update color docs
stefan-laux Nov 20, 2025
a6caf2a
test new pkg
stefan-laux Nov 21, 2025
2e5a450
update publish commands for UI libraries in pkg.pr.new.yml
stefan-laux Nov 21, 2025
0474c65
Update pkg.pr.new.yml
stefan-laux Nov 21, 2025
d21e3a9
fix run command
stefan-laux Nov 21, 2025
a2ecfc4
remove publish commands for unused UI libraries in pkg.pr.new.yml
stefan-laux Dec 1, 2025
9b145f2
Merge remote-tracking branch 'origin/feature/theme-support' into feat…
stefan-laux Dec 1, 2025
d243f05
remove publish commands for unused UI libraries in pkg.pr.new.yml
stefan-laux Dec 1, 2025
c2b7d9e
add hover background colors for file upload drop zones and clean up u…
stefan-laux Dec 1, 2025
76a2013
little change after little meeting with design team
stefan-laux Dec 1, 2025
a5cb45e
Merge branch 'main' into feature/theme-support
stefan-laux Mar 27, 2026
63c7817
fix merge conflicts
stefan-laux Mar 27, 2026
924309c
Merge branch 'main' into feature/theme-support
stefan-laux May 18, 2026
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
16 changes: 16 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const componentNavItems = components.map((component) => {
// https://vitepress.dev/reference/site-config
export default withMermaid({
ignoreDeadLinks: [/^https?:\/\/localhost/, './../wrappers/set-attributes'],
appearance: false,
head: [['link', { rel: 'icon', href: 'favicon.ico' }]],
title: 'Web Components',
description: 'Component Library following the SIX Style Guide',
Expand Down
32 changes: 32 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,32 @@ import DefaultTheme from 'vitepress/theme';
import './style.css';
import { defineCustomElements } from '@six-group/ui-library/loader';
import { Theme } from 'vitepress';
import { onMounted, watch } from 'vue';
import { useData } from 'vitepress';

// @ts-ignore
const modules = import.meta.glob('../../examples/**/*.vue', { eager: true });
const exampleComponents = [];
for (const path in modules) {
exampleComponents.push(modules[path].default);
}

// Sync VitePress theme with HTML class
function syncThemeClass(isDark: boolean) {
const htmlElement = document.documentElement;
htmlElement.classList.remove('theme-light', 'theme-dark');
htmlElement.classList.add(isDark ? 'theme-dark' : 'theme-light');
}

// Initialize theme class immediately on load (before Vue mounts)
if (typeof window !== 'undefined') {
const savedTheme = localStorage.getItem('vitepress-theme-appearance');
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
const isDark =
savedTheme === 'dark' || (savedTheme === 'auto' && prefersDark) || (!savedTheme && prefersDark);
syncThemeClass(isDark);
}

export default {
extends: DefaultTheme,
Layout: () => {
Expand All @@ -27,4 +46,17 @@ export default {
app.component(component.name, component);
});
},
setup() {
const { isDark } = useData();

// Set initial theme class on mount
onMounted(() => {
syncThemeClass(isDark.value);
});

// Watch for theme changes and update HTML class
watch(isDark, (newIsDark) => {
syncThemeClass(newIsDark);
});
},
} satisfies Theme;
65 changes: 63 additions & 2 deletions docs/.vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,59 @@
*/

/**
* Colors
--vp-code-block-color
* Colors - Light Theme
* -------------------------------------------------------------------------- */

:root {
/* Brand colors */
--vp-c-brand-1: #de3919;
--vp-c-brand-2: #e83c1a;
--vp-c-brand-3: #f23f1b;
--vp-c-brand-soft: #f7401b;

/* Text colors */
--vp-c-text-1: unset;

/* Layout */
--vp-nav-logo-height: 14px;

/* Search */
--vp-local-search-highlight-bg: none;
--vp-local-search-highlight-text: var(--vp-c-brand-1);

/* Code blocks - Light theme */
--vp-code-block-bg: #f6f6f7;
--vp-code-bg: #f6f6f7;
--vp-code-color: #383a42;
}

/**
* Colors - Dark Theme
* -------------------------------------------------------------------------- */
.dark,
.theme-dark {
/* Code blocks - Dark theme */
--vp-code-block-bg: #1e1e1e;
--vp-code-bg: #1e1e1e;
--vp-code-color: #abb2bf;

/* Background colors */
--vp-c-bg: var(--six-color-dark-background-color);
--vp-c-bg-soft: #242424;
--vp-c-bg-mute: #2c2c2c;
--vp-c-bg-alt: #151515;

/* Divider colors */
--vp-c-divider: #2e2e2e;
--vp-c-gutter: #1a1a1a;

/* Text colors */
--vp-c-text-1: rgba(255, 255, 245, 0.86);
--vp-c-text-2: rgba(235, 235, 245, 0.6);
--vp-c-text-3: rgba(235, 235, 245, 0.38);

/* Sidebar */
--vp-sidebar-bg-color: #232323;
}

/**
Expand All @@ -46,6 +85,28 @@
/* overwrite to match color of vitepress code background */
code {
background: var(--vp-code-bg);
color: var(--vp-code-color);
}

/* Code blocks styling */
.vp-doc div[class*='language-'] {
background-color: var(--vp-code-block-bg);
}

.vp-doc div[class*='language-'] code {
color: var(--vp-code-color);
}

/* Improve code block header visibility in dark mode */
.dark .vp-doc div[class*='language-'] .lang,
.theme-dark .vp-doc div[class*='language-'] .lang {
color: rgba(235, 235, 245, 0.6);
}

/* Improve line numbers visibility */
.dark .vp-doc .line-numbers-wrapper,
.theme-dark .vp-doc .line-numbers-wrapper {
color: rgba(235, 235, 245, 0.3);
}

/*
Expand Down
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

### Added

- Added the ability to disable the `ValidationService` on Angular. See
[docs](./guide/angular.md#customisingdisabling-validationservice) for more details.
- `six-root`: Added theme support (dark/light/auto) in coordination with design team.
- Added param library to choose the icon library also in `six-icon-button` and `six-tile` (default
is material-icons)
- New `six-paginator` component (experimental).
Expand Down
2 changes: 2 additions & 0 deletions docs/components/six-icon-button.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ Often icon buttons are combined with badges to signal new entries. For this simp
- [six-tab](six-tab.html)
- [six-tab-group](six-tab-group.html)
- [six-tag](six-tag.html)
- [six-theme-switcher](six-theme-switcher.html)
- [six-tile](six-tile.html)

### Depends on
Expand All @@ -222,6 +223,7 @@ graph TD;
six-tab --> six-icon-button
six-tab-group --> six-icon-button
six-tag --> six-icon-button
six-theme-switcher --> six-icon-button
six-tile --> six-icon-button
style six-icon-button fill:#f9f,stroke:#333,stroke-width:4px
```
Expand Down
151 changes: 151 additions & 0 deletions docs/components/six-theme-switcher.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
# Theme Switcher

A simple icon button that toggles between light and dark themes. Works with six-root's theme management system.


## Theme Switcher

The `six-theme-switcher` is a simple icon button that toggles between light and dark themes. It automatically syncs with `six-root`'s theme management system.

<docs-demo-six-theme-switcher-0></docs-demo-six-theme-switcher-0>

```html
<div style="background: grey">
<six-theme-switcher></six-theme-switcher>
</div>
```


## Sizes

Theme switchers inherit the same size options as icon buttons.

<docs-demo-six-theme-switcher-1></docs-demo-six-theme-switcher-1>

```html
<div style="background: grey">
<six-theme-switcher size="xSmall"></six-theme-switcher>
<six-theme-switcher size="small"></six-theme-switcher>
<six-theme-switcher size="medium"></six-theme-switcher>
<six-theme-switcher size="large"></six-theme-switcher>
<six-theme-switcher size="xLarge"></six-theme-switcher>
</div>
```


## Disabled

Set the `disabled` attribute to disable the theme switcher.

<docs-demo-six-theme-switcher-2></docs-demo-six-theme-switcher-2>

```html
<div style="background: grey">
<six-theme-switcher disabled></six-theme-switcher>
</div>
```


## Custom Label

Provide a custom label for screen readers using the `label` attribute. This improves accessibility.

<docs-demo-six-theme-switcher-3></docs-demo-six-theme-switcher-3>

```html
<div style="background: grey">
<six-theme-switcher label="Switch between light and dark mode"></six-theme-switcher>
</div>
```


## With Tooltip

Wrap a tooltip around the theme switcher to provide contextual information to the user.

<docs-demo-six-theme-switcher-4></docs-demo-six-theme-switcher-4>

```html
<div style="background: grey">
<six-tooltip content="Toggle theme">
<six-theme-switcher></six-theme-switcher>
</six-tooltip>
</div>
```


## In Header

The theme switcher is commonly used in application headers.

<docs-demo-six-theme-switcher-5></docs-demo-six-theme-switcher-5>

```html
<div style="border: 1px solid var(--six-color-web-rock-300); border-radius: 4px">
<six-root>
<six-header slot="header">
<six-header-item>
<six-icon-button name="menu"></six-icon-button>
</six-header-item>

<six-header-item>
<six-logo></six-logo>
</six-header-item>

<six-header-item style="margin-left: auto">
<six-theme-switcher></six-theme-switcher>
</six-header-item>

<six-header-item>
<six-icon-button name="settings"></six-icon-button>
</six-header-item>
</six-header>
</six-root>
</div>
```



<!-- Auto Generated Below -->


## Properties

| Property | Attribute | Description | Type | Default |
| ---------- | ---------- | ----------------------------------------------- | ----------------------------------------------------------------------------------- | ---------------- |
| `disabled` | `disabled` | Set to true to disable the theme switcher. | `boolean` | `false` |
| `label` | `label` | A description that gets read by screen readers. | `string` | `'Toggle theme'` |
| `size` | `size` | The icon button's size. | `"large" \| "medium" \| "small" \| "xLarge" \| "xSmall" \| "xxLarge" \| "xxxLarge"` | `'medium'` |


## Events

| Event | Description | Type |
| --------------------------- | ---------------------------------- | ------------------------ |
| `six-theme-switcher-change` | Emitted when the theme is changed. | `CustomEvent<undefined>` |


## Shadow Parts

| Part | Description |
| -------- | ----------------------------- |
| `"base"` | The component's base wrapper. |


## Dependencies

### Depends on

- [six-icon-button](six-icon-button.html)

### Graph
```mermaid
graph TD;
six-theme-switcher --> six-icon-button
six-icon-button --> six-icon
style six-theme-switcher fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

Copyright Β© 2021-present SIX-Group
Loading
Loading