File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 7
7
// Makes it easier to look through a DOM, and easier to change the style of all
8
8
// instances of a class.
9
9
10
- // We keep the default/regular styles and dark-mode styles in separate stylesheets.
11
- const cssStyle = dom . style ( attr . type ( 'text/css' ) )
12
- document . head . prepend ( cssStyle )
13
- const styleSheet = cssStyle . sheet !
14
-
15
10
const cssStyleDark = dom . style ( attr . type ( 'text/css' ) )
16
11
document . head . prepend ( cssStyleDark )
17
12
const styleSheetDark = cssStyleDark . sheet !
18
13
styleSheetDark . insertRule ( '@media (prefers-color-scheme: dark) {}' )
19
14
const darkModeRule = styleSheetDark . cssRules [ 0 ] as CSSMediaRule
20
15
16
+ // We keep the default/regular styles and dark-mode styles in separate stylesheets.
17
+ const cssStyle = dom . style ( attr . type ( 'text/css' ) )
18
+ document . head . prepend ( cssStyle )
19
+ const styleSheet = cssStyle . sheet !
20
+
21
21
let cssRules : { [ selector : string ] : string } = { } // For ensuring a selector has a single definition.
22
22
// Ensure a selector has the given style properties. If a style value is an array,
23
23
// it must have 2 elements. The first is the default value, the second used for a
Original file line number Diff line number Diff line change @@ -1062,15 +1062,15 @@ var api;
1062
1062
// - To use class names for styling, instead of the the many inline styles.
1063
1063
// Makes it easier to look through a DOM, and easier to change the style of all
1064
1064
// instances of a class.
1065
- // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1066
- const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1067
- document . head . prepend ( cssStyle ) ;
1068
- const styleSheet = cssStyle . sheet ;
1069
1065
const cssStyleDark = dom . style ( attr . type ( 'text/css' ) ) ;
1070
1066
document . head . prepend ( cssStyleDark ) ;
1071
1067
const styleSheetDark = cssStyleDark . sheet ;
1072
1068
styleSheetDark . insertRule ( '@media (prefers-color-scheme: dark) {}' ) ;
1073
1069
const darkModeRule = styleSheetDark . cssRules [ 0 ] ;
1070
+ // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1071
+ const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1072
+ document . head . prepend ( cssStyle ) ;
1073
+ const styleSheet = cssStyle . sheet ;
1074
1074
let cssRules = { } ; // For ensuring a selector has a single definition.
1075
1075
// Ensure a selector has the given style properties. If a style value is an array,
1076
1076
// it must have 2 elements. The first is the default value, the second used for a
Original file line number Diff line number Diff line change @@ -1062,15 +1062,15 @@ var api;
1062
1062
// - To use class names for styling, instead of the the many inline styles.
1063
1063
// Makes it easier to look through a DOM, and easier to change the style of all
1064
1064
// instances of a class.
1065
- // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1066
- const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1067
- document . head . prepend ( cssStyle ) ;
1068
- const styleSheet = cssStyle . sheet ;
1069
1065
const cssStyleDark = dom . style ( attr . type ( 'text/css' ) ) ;
1070
1066
document . head . prepend ( cssStyleDark ) ;
1071
1067
const styleSheetDark = cssStyleDark . sheet ;
1072
1068
styleSheetDark . insertRule ( '@media (prefers-color-scheme: dark) {}' ) ;
1073
1069
const darkModeRule = styleSheetDark . cssRules [ 0 ] ;
1070
+ // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1071
+ const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1072
+ document . head . prepend ( cssStyle ) ;
1073
+ const styleSheet = cssStyle . sheet ;
1074
1074
let cssRules = { } ; // For ensuring a selector has a single definition.
1075
1075
// Ensure a selector has the given style properties. If a style value is an array,
1076
1076
// it must have 2 elements. The first is the default value, the second used for a
Original file line number Diff line number Diff line change @@ -1062,15 +1062,15 @@ var api;
1062
1062
// - To use class names for styling, instead of the the many inline styles.
1063
1063
// Makes it easier to look through a DOM, and easier to change the style of all
1064
1064
// instances of a class.
1065
- // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1066
- const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1067
- document . head . prepend ( cssStyle ) ;
1068
- const styleSheet = cssStyle . sheet ;
1069
1065
const cssStyleDark = dom . style ( attr . type ( 'text/css' ) ) ;
1070
1066
document . head . prepend ( cssStyleDark ) ;
1071
1067
const styleSheetDark = cssStyleDark . sheet ;
1072
1068
styleSheetDark . insertRule ( '@media (prefers-color-scheme: dark) {}' ) ;
1073
1069
const darkModeRule = styleSheetDark . cssRules [ 0 ] ;
1070
+ // We keep the default/regular styles and dark-mode styles in separate stylesheets.
1071
+ const cssStyle = dom . style ( attr . type ( 'text/css' ) ) ;
1072
+ document . head . prepend ( cssStyle ) ;
1073
+ const styleSheet = cssStyle . sheet ;
1074
1074
let cssRules = { } ; // For ensuring a selector has a single definition.
1075
1075
// Ensure a selector has the given style properties. If a style value is an array,
1076
1076
// it must have 2 elements. The first is the default value, the second used for a
You can’t perform that action at this time.
0 commit comments