Skip to content
Open
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
15 changes: 15 additions & 0 deletions demo/app-root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ export class AppRoot extends LitElement {
return html`
<h1>🏛️ Internet Archive Elements ⚛️</h1>

<fieldset>
<legend>Settings</legend>
<label for="darkModeToggle">Dark Mode</label>
<input type="checkbox" switch @change=${this.toggleDarkMode} />
</fieldset>

<h2>🚀 Production-Ready Elements</h2>

<ia-status-indicator-story></ia-status-indicator-story>
Expand All @@ -21,4 +27,13 @@ export class AppRoot extends LitElement {
<ia-button-story></ia-button-story>
`;
}

private toggleDarkMode(event: Event) {
const checkbox = event.target as HTMLInputElement;
if (checkbox.checked) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
}
}
16 changes: 15 additions & 1 deletion demo/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@
-moz-osx-font-smoothing: grayscale;
}

:root.dark {
color-scheme: dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;

--ia-theme-primary-background-color: #242424;
--ia-theme-secondary-background-color: #1e1e1e;
--ia-theme-primary-text-color: rgba(255, 255, 255, 0.87);
--ia-theme-secondary-text-color: #a0a0a0;
--ia-theme-link-color: #4b64ff;
--ia-theme-primary-cta-fill: #4b64ff;
--ia-theme-primary-cta-text-color: #ffffff;
}

a {
font-weight: 500;
color: #646cff;
color: var(--ia-theme-link-color);
text-decoration: inherit;
}

Expand Down
1 change: 1 addition & 0 deletions demo/story-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ import { ${this.elementClassName} } from '${this.modulePath}';
height: 12px;
transform: rotate(-90deg);
transition: transform 0.2s ease-in-out;
filter: invert(0.5);
}

.disclosure-arrow.open {
Expand Down