-
Notifications
You must be signed in to change notification settings - Fork 4
Feature/469 intro dark alternative #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
dbf29e9
ede144f
a1419fc
a954b13
53766a3
328a533
7ca87c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TerranceKhumalo-absa I'm not sure was it intended or not, so I'll just gather the list suspicious props in files: |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
| <div class="theme-controls"> | ||
| <button | ||
| class="theme-toggle-btn" | ||
| (click)="toggleMenu()" | ||
| [attr.aria-expanded]="menuOpen" | ||
| aria-label="Open appearance settings" | ||
| type="button"> | ||
| Customize | ||
| <span class="theme-toggle-caret">▾</span> | ||
| </button> | ||
| @if (menuOpen) { | ||
| <div class="menu-backdrop" aria-hidden="true" (click)="closeMenu()"></div> | ||
| <div class="theme-menu" aria-label="Appearance settings"> | ||
| <div class="theme-menu-header"> | ||
| <div class="theme-menu-title">Appearance</div> | ||
| <div class="theme-menu-subtitle">Theme, radius and dark base</div> | ||
| </div> | ||
| <section class="theme-section theme-section-theme" aria-label="Theme"> | ||
| <h4 class="theme-section-title">Theme</h4> | ||
| <div class="theme-options"> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="colorTheme() === 'neutral'" | ||
| (click)="setColorTheme('neutral')"> | ||
| <span class="option-dot"></span> | ||
| Neutral | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="colorTheme() === 'calm'" | ||
| (click)="setColorTheme('calm')"> | ||
| <span class="option-dot"></span> | ||
| Calm | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="colorTheme() === 'energy'" | ||
| (click)="setColorTheme('energy')"> | ||
| <span class="option-dot"></span> | ||
| Energy | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="colorTheme() === 'passion'" | ||
| (click)="setColorTheme('passion')"> | ||
| <span class="option-dot"></span> | ||
| Passion | ||
| </button> | ||
|
Comment on lines
+21
to
+52
|
||
| </div> | ||
| </section> | ||
| <section class="theme-section" aria-label="Radius"> | ||
| <h4 class="theme-section-title">Radius</h4> | ||
| <div class="theme-options"> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="radiusTheme() === 'none'" | ||
| (click)="setRadiusTheme('none')"> | ||
| None | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="radiusTheme() === 'compact'" | ||
| (click)="setRadiusTheme('compact')"> | ||
| Compact | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="radiusTheme() === 'rounded'" | ||
| (click)="setRadiusTheme('rounded')"> | ||
| Rounded | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="radiusTheme() === 'pill'" | ||
| (click)="setRadiusTheme('pill')"> | ||
| Pill | ||
| </button> | ||
| </div> | ||
| </section> | ||
| <section class="theme-section" aria-label="Base"> | ||
| <h4 class="theme-section-title">Base</h4> | ||
| <p class="theme-section-hint">Base affects dark mode surfaces.</p> | ||
| <div class="theme-options"> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="baseTheme() === 'default'" | ||
| (click)="setBaseTheme('default')"> | ||
| Default | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="baseTheme() === 'graphite'" | ||
| (click)="setBaseTheme('graphite')"> | ||
| Graphite | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="baseTheme() === 'midnight'" | ||
| (click)="setBaseTheme('midnight')"> | ||
| Midnight | ||
| </button> | ||
| <button | ||
| type="button" | ||
| class="theme-option" | ||
| [class.selected]="baseTheme() === 'aubergine'" | ||
| (click)="setBaseTheme('aubergine')"> | ||
| Aubergine | ||
| </button> | ||
| </div> | ||
| </section> | ||
| </div> | ||
| } | ||
| <button | ||
| class="theme-toggle-btn" | ||
| (click)="toggleTheme()" | ||
| [attr.aria-label]=" | ||
| isDark() ? 'Switch to light mode' : 'Switch to dark mode' | ||
| " | ||
| type="button"> | ||
|
Comment on lines
+124
to
+130
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @TerranceKhumalo-absa could we expose the toggle state with aria-pressed or role="switch" + aria-checked? Right now the icon button only has a label. |
||
| <cps-icon [icon]="isDark() ? 'sun' : 'moon'" [size]="20"> </cps-icon> | ||
| </button> | ||
| </div> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TerranceKhumalo-absa in
projects/composition/src/app/app.component.spec.tscould we import ThemeToggleComponent in the test module? ng test logs app-theme-toggle is not a known element, which masks template errors.