feat: add CHRNX shell and theme preference
This commit is contained in:
18 files changed
+633
-16
No files matched your search
@@ -16,7 +16,11 @@ function createMedia( matches = false ) {
|
||||
|
||||
function toggleMarkup() {
|
||||
document.body.innerHTML = `
|
||||
<fieldset class="chrnx-theme-toggle" data-chrnx-theme-toggle>
|
||||
<fieldset class="chrnx-theme-toggle" data-chrnx-theme-toggle
|
||||
data-status-light="Light theme active"
|
||||
data-status-dark="Dark theme active"
|
||||
data-status-system-light="Light theme active, following system preference"
|
||||
data-status-system-dark="Dark theme active, following system preference">
|
||||
<legend>Color theme</legend>
|
||||
<label><input type="radio" name="theme-a" value="light">Light</label>
|
||||
<label><input type="radio" name="theme-a" value="dark">Dark</label>
|
||||
@@ -124,6 +128,9 @@ describe( 'theme preference helpers', () => {
|
||||
status.textContent.includes( 'Light' ),
|
||||
),
|
||||
).toBe( true );
|
||||
expect( document.querySelector( '[data-chrnx-theme-status]' ).textContent ).toBe(
|
||||
'Light theme active',
|
||||
);
|
||||
expect( document.querySelector( 'fieldset' ).textContent ).toContain( 'Color theme' );
|
||||
} );
|
||||
|
||||
|
||||
Reference in new issue
Block a user