Skip to content

Commit 8c66599

Browse files
committed
fix: hotfixes for storybook themes and eslint
1 parent 8b0b82a commit 8c66599

5 files changed

Lines changed: 7 additions & 30 deletions

File tree

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"extends": ["prettier"],
33
"overrides": [
44
{
5-
"files": ["**/*.{mjs,ts,tsx}"],
5+
"files": ["**/*.{js,mjs,ts,tsx}"],
66
"extends": ["eslint:recommended"],
7-
"env": { "jest": true, "es6": true }
7+
"env": { "jest": true, "es6": true, "browser": true }
88
},
99
{
1010
"files": ["**/*.{mjs,ts,tsx,mdx}"],

.storybook/preview.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import NextImage from 'next/image';
22
import { withThemeByDataAttribute } from '@storybook/addon-themes';
33
import { SiteProvider } from '../providers/siteProvider';
4-
import { ThemeProvider } from '../providers/themeProvider';
54
import { LocaleProvider } from '../providers/localeProvider';
65
import { OPEN_SANS_FONT, STORYBOOK_MODES, STORYBOOK_SIZES } from './constants';
76
import type { Preview, ReactRenderer } from '@storybook/react';
@@ -21,11 +20,9 @@ const preview: Preview = {
2120
Story => (
2221
<SiteProvider>
2322
<LocaleProvider>
24-
<ThemeProvider>
25-
<div className={`${OPEN_SANS_FONT.variable}`}>
26-
<Story />
27-
</div>
28-
</ThemeProvider>
23+
<div className={`${OPEN_SANS_FONT.variable}`}>
24+
<Story />
25+
</div>
2926
</LocaleProvider>
3027
</SiteProvider>
3128
),

public/static/js/legacyMain.js

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,13 @@ const themeAttr = 'data-theme';
22

33
const setTheme = theme => {
44
document.querySelector('html').setAttribute(themeAttr, theme);
5-
document.body.className = theme;
65
window.localStorage.setItem('theme', theme);
76
};
87

98
const preferredColorScheme = window.matchMedia('(prefers-color-scheme: dark)');
109

1110
const getTheme = () => window.localStorage.getItem('theme');
1211

13-
const versionIntoHref = (nodeList, filename) => {
14-
const linkEls = Array.prototype.slice.call(nodeList);
15-
let version;
16-
let el;
17-
18-
for (let i = 0; i < linkEls.length; i++) {
19-
version = linkEls[i].getAttribute('data-version');
20-
el = linkEls[i];
21-
el.href += filename.replace('%version%', version);
22-
}
23-
};
24-
2512
const listenLanguagePickerButton = () => {
2613
const langPickerTogglerElement = document.querySelector(
2714
'.lang-picker-toggler'

styles/old/base.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
body {
1+
html {
22
background-color: $white;
33
box-sizing: border-box;
44
color: $node-gray;

styles/old/layout/dark-theme.css

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
[data-theme='dark'] body,
2-
body.dark {
1+
html[data-theme='dark'] {
32
background-color: $dark-black;
43
color: $white;
5-
}
6-
7-
[data-theme='dark'] body,
8-
.dark {
94
color-scheme: dark;
105

116
.dark-theme-switcher {
@@ -23,8 +18,6 @@ body.dark {
2318
}
2419

2520
#main {
26-
background-color: $dark-black;
27-
2821
p,
2922
h1,
3023
h2,

0 commit comments

Comments
 (0)