@vuepress/theme-default 2.0.0-rc.37 → 2.0.0-rc.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,8 +23,8 @@ const features = computed(() => frontmatter.value.features ?? [])
23
23
  .vp-features {
24
24
  display: flex;
25
25
  flex-wrap: wrap;
26
- align-items: flex-start;
27
26
  place-content: stretch space-between;
27
+ align-items: flex-start;
28
28
 
29
29
  margin-top: 2.5rem;
30
30
  padding: 1.2rem 0;
@@ -160,7 +160,6 @@ const HomeHeroImage: FunctionalComponent = () => {
160
160
  display: inline-block;
161
161
 
162
162
  box-sizing: border-box;
163
-
164
163
  padding: 0.8rem 1.6rem;
165
164
  border-width: 2px;
166
165
  border-style: solid;
@@ -91,7 +91,6 @@ useUpdateDeviceStatus(
91
91
  z-index: 20;
92
92
 
93
93
  box-sizing: border-box;
94
-
95
94
  height: var(--navbar-height);
96
95
  padding: var(--navbar-padding-v) var(--navbar-padding-h);
97
96
  border-bottom: 1px solid var(--c-border);
@@ -117,7 +116,6 @@ useUpdateDeviceStatus(
117
116
  display: flex;
118
117
 
119
118
  box-sizing: border-box;
120
-
121
119
  height: var(--navbar-line-height);
122
120
  padding-left: var(--navbar-padding-h);
123
121
 
@@ -153,6 +153,7 @@ watch(
153
153
  display: none;
154
154
 
155
155
  overflow-y: auto;
156
+
156
157
  box-sizing: border-box;
157
158
 
158
159
  // Avoid height shake by clicking
@@ -30,8 +30,8 @@ defineSlots<{
30
30
  z-index: 10;
31
31
 
32
32
  overflow-y: auto;
33
- box-sizing: border-box;
34
33
 
34
+ box-sizing: border-box;
35
35
  width: var(--sidebar-width);
36
36
  margin: 0;
37
37
  border-right: 1px solid var(--c-border);
@@ -99,7 +99,6 @@ onBeforeUnmount(() => {
99
99
 
100
100
  &.vp-sidebar-heading {
101
101
  box-sizing: border-box;
102
-
103
102
  width: 100%;
104
103
  margin: 0;
105
104
  padding: 0.35rem 1.5rem 0.35rem 1.25rem;
@@ -124,7 +123,6 @@ onBeforeUnmount(() => {
124
123
  display: inline-block;
125
124
 
126
125
  box-sizing: border-box;
127
-
128
126
  width: 100%;
129
127
  margin: 0;
130
128
  padding: 0.35rem 1rem 0.35rem 2rem;
@@ -9,4 +9,3 @@ export declare const useDarkMode: () => DarkModeRef;
9
9
  * Create dark mode ref and provide as global computed in setup
10
10
  */
11
11
  export declare const setupDarkMode: () => void;
12
- export declare const updateHtmlDarkClass: (isDarkMode: DarkModeRef) => void;
@@ -2,6 +2,18 @@ import { useThemeLocaleData } from '@theme/useThemeData';
2
2
  import { usePreferredDark, useStorage } from '@vueuse/core';
3
3
  import { computed, inject, onMounted, onUnmounted, provide, watch } from 'vue';
4
4
  export const darkModeSymbol = Symbol(__VUEPRESS_DEV__ ? 'darkMode' : '');
5
+ const applyDarkmodeToHTML = (isDarkMode) => {
6
+ const update = (value = isDarkMode.value) => {
7
+ // set `class="dark"` on `<html>` element
8
+ const el = window.document.documentElement;
9
+ el.classList.toggle('dark', value);
10
+ el.dataset.theme = value ? 'dark' : 'light';
11
+ };
12
+ onMounted(() => {
13
+ watch(isDarkMode, update, { immediate: true });
14
+ });
15
+ onUnmounted(() => update());
16
+ };
5
17
  /**
6
18
  * Inject dark mode global computed
7
19
  */
@@ -42,16 +54,5 @@ export const setupDarkMode = () => {
42
54
  },
43
55
  });
44
56
  provide(darkModeSymbol, isDarkMode);
45
- updateHtmlDarkClass(isDarkMode);
46
- };
47
- export const updateHtmlDarkClass = (isDarkMode) => {
48
- const update = (value = isDarkMode.value) => {
49
- // set `class="dark"` on `<html>` element
50
- const htmlEl = window?.document.querySelector('html');
51
- htmlEl?.classList.toggle('dark', value);
52
- };
53
- onMounted(() => {
54
- watch(isDarkMode, update, { immediate: true });
55
- });
56
- onUnmounted(() => update());
57
+ applyDarkmodeToHTML(isDarkMode);
57
58
  };
@@ -49,7 +49,7 @@ export const useNavbarSelectLanguage = () => {
49
49
  // try to keep current hash and params across languages
50
50
  link: routePaths.value.some((item) => item === targetLocalePage)
51
51
  ? currentFullPath.replace(currentPath, targetLocalePage)
52
- : targetThemeLocale.home ?? targetLocalePath,
52
+ : (targetThemeLocale.home ?? targetLocalePath),
53
53
  };
54
54
  }),
55
55
  };
@@ -70,19 +70,19 @@ export const useRelatedLinks = () => {
70
70
  const prevConfig = resolveFromFrontmatterConfig(frontmatter.value.prev, route.path);
71
71
  return prevConfig === false
72
72
  ? null
73
- : prevConfig ??
73
+ : (prevConfig ??
74
74
  (themeLocale.value.prev === false
75
75
  ? null
76
- : resolveFromSidebarItems(sidebarItems.value, route.path, -1));
76
+ : resolveFromSidebarItems(sidebarItems.value, route.path, -1)));
77
77
  });
78
78
  const nextLink = computed(() => {
79
79
  const nextConfig = resolveFromFrontmatterConfig(frontmatter.value.next, route.path);
80
80
  return nextConfig === false
81
81
  ? null
82
- : nextConfig ??
82
+ : (nextConfig ??
83
83
  (themeLocale.value.next === false
84
84
  ? null
85
- : resolveFromSidebarItems(sidebarItems.value, route.path, 1));
85
+ : resolveFromSidebarItems(sidebarItems.value, route.path, 1)));
86
86
  });
87
87
  return {
88
88
  prevLink,
@@ -55,7 +55,7 @@ export const setupSidebarItems = () => {
55
55
  const headers = useHeaders();
56
56
  const sidebarConfig = computed(() => frontmatter.value.home
57
57
  ? false
58
- : frontmatter.value.sidebar ?? themeLocale.value.sidebar ?? 'heading');
58
+ : (frontmatter.value.sidebar ?? themeLocale.value.sidebar ?? 'heading'));
59
59
  const sidebarItems = computed(() => resolveSidebarItems(sidebarConfig.value, page.value, route.path, routeLocale.value, headers.value));
60
60
  provide(sidebarItemsSymbol, sidebarItems);
61
61
  };
@@ -13,7 +13,7 @@ const homeText = themeLocale.value.backToHome ?? 'Back to home'
13
13
  </script>
14
14
 
15
15
  <template>
16
- <div class="theme-container">
16
+ <div class="vp-theme-container">
17
17
  <main class="page">
18
18
  <div class="theme-default-content">
19
19
  <h1>404</h1>
@@ -25,3 +25,17 @@ const homeText = themeLocale.value.backToHome ?? 'Back to home'
25
25
  </main>
26
26
  </div>
27
27
  </template>
28
+
29
+ <style scoped lang="scss">
30
+ .vp-theme-container {
31
+ max-width: 740px;
32
+ margin: 0 auto;
33
+ padding: 2rem 2.5rem;
34
+ }
35
+
36
+ @media (max-width: 959px) {
37
+ .vp-theme-container {
38
+ padding: 2rem;
39
+ }
40
+ }
41
+ </style>
@@ -1,247 +1,23 @@
1
- /* stylelint-disable no-duplicate-selectors */
2
- /* stylelint-disable scss/comment-no-empty */
3
1
  @import '../variables';
4
2
 
5
- // the original font-size is 14px, 1.7 will make line-height be 23.8px
6
- $line-height: 1.7;
7
-
8
- pre[class*='language-'] {
9
- overflow: auto;
10
-
11
- margin: 0.5em 0;
12
-
13
- font-size: 1em;
14
- font-family: var(--font-family-code);
15
- line-height: 1.5;
16
- }
17
-
18
- // ===============================
19
- // Forked and modified from prismjs/themes/prism-tomorrow.css
20
-
21
- pre[class*='language-'] {
22
- background: #2d2d2d;
23
- color: #ccc;
24
- }
25
-
26
- .token.comment,
27
- .token.block-comment,
28
- .token.prolog,
29
- .token.doctype,
30
- .token.cdata {
31
- color: #999;
32
- }
33
-
34
- .token.punctuation {
35
- color: #ccc;
36
- }
37
-
38
- .token.tag,
39
- .token.attr-name,
40
- .token.namespace,
41
- .token.deleted {
42
- color: #ec5975;
43
- }
44
-
45
- .token.function-name {
46
- color: #6196cc;
47
- }
48
-
49
- .token.boolean,
50
- .token.number,
51
- .token.function {
52
- color: #f08d49;
53
- }
54
-
55
- .token.property,
56
- .token.class-name,
57
- .token.constant,
58
- .token.symbol {
59
- color: #f8c555;
60
- }
61
-
62
- .token.selector,
63
- .token.important,
64
- .token.atrule,
65
- .token.keyword,
66
- .token.builtin {
67
- color: #cc99cd;
68
- }
69
-
70
- .token.string,
71
- .token.char,
72
- .token.attr-value,
73
- .token.regex,
74
- .token.variable {
75
- color: #7ec699;
76
- }
77
-
78
- .token.operator,
79
- .token.entity,
80
- .token.url {
81
- color: #67cdcc;
82
- }
83
-
84
- .token.important,
85
- .token.bold {
86
- font-weight: bold;
87
- }
88
-
89
- .token.italic {
90
- font-style: italic;
91
- }
92
-
93
- .token.entity {
94
- cursor: help;
95
- }
96
-
97
- .token.inserted {
98
- color: #3eaf7c;
99
- }
100
-
101
- // ===============================
102
-
103
- .theme-default-content {
104
- pre,
105
- pre[class*='language-'] {
106
- overflow: auto;
107
- margin: 0.85rem 0;
108
- border-radius: 6px;
109
- line-height: $line-height;
110
-
111
- code {
112
- display: block;
113
-
114
- box-sizing: border-box;
115
-
116
- width: fit-content;
117
- min-width: 100%;
118
- padding: 1.3rem 1.5rem;
119
- border-radius: 0;
120
-
121
- background-color: transparent !important;
122
- color: #fff;
123
-
124
- overflow-wrap: unset;
125
-
126
- -webkit-font-smoothing: auto;
127
- -moz-osx-font-smoothing: auto;
128
- }
129
- }
130
-
131
- .line-number {
132
- font-family: var(--font-family-code);
133
- }
134
- }
135
-
3
+ // code block additional styles
136
4
  div[class*='language-'] {
137
- position: relative;
138
- border-radius: 6px;
139
- background-color: var(--code-bg-color);
140
-
141
- &::before {
142
- content: attr(data-title);
143
-
144
- position: absolute;
145
- top: 0.8em;
146
- right: 1em;
147
- z-index: 3;
148
-
149
- color: var(--code-line-number-color);
150
-
151
- font-size: 0.75rem;
152
- }
153
-
154
- pre,
155
- pre[class*='language-'] {
156
- position: relative;
157
- z-index: 1;
158
-
159
- // force override the background color to be compatible with shiki
160
- background: transparent !important;
161
- }
162
-
163
- &:not(.line-numbers-mode) {
164
- .line-numbers {
165
- display: none;
166
- }
167
- }
168
-
169
- &.line-numbers-mode {
170
- pre {
171
- vertical-align: middle;
172
- margin-left: var(--code-line-number-wrapper-width);
173
- }
5
+ margin: 0.75rem 0;
6
+ transition:
7
+ background-color var(--t-color),
8
+ color var(--t-color);
174
9
 
175
- code {
176
- padding-left: 1rem;
177
- }
178
-
179
- .line-numbers {
180
- position: absolute;
181
- top: 0;
182
-
183
- width: var(--code-line-number-wrapper-width);
184
- padding-top: 1.3rem;
185
-
186
- color: var(--code-line-number-color);
187
-
188
- font-size: 0.875em;
189
- line-height: $line-height;
190
- counter-reset: line-number;
191
- text-align: center;
192
-
193
- .line-number {
194
- position: relative;
195
- z-index: 3;
196
- user-select: none;
197
-
198
- /* stylelint-disable-next-line max-nesting-depth */
199
- &::before {
200
- content: counter(line-number);
201
- counter-increment: line-number;
202
- }
203
- }
204
- }
205
-
206
- &::after {
207
- content: '';
208
-
209
- position: absolute;
210
- top: 0;
211
- left: 0;
10
+ @media (max-width: $MQMobileNarrow) {
11
+ --code-border-radius: 0;
212
12
 
213
- width: var(--code-line-number-wrapper-width);
214
- height: 100%;
215
- border-right: 1px solid var(--code-highlight-bg-color);
216
- border-radius: 6px 0 0 6px;
217
- }
218
- }
219
- }
220
-
221
- // ------------ plugin-shiki code highlighting ------------
222
- div[data-highlighter='shiki'] {
223
- background-color: var(--shiki-light-bg, var(--code-bg-color));
224
- transition: background-color var(--t-color);
225
-
226
- .dark & {
227
- background-color: var(--shiki-dark-bg, var(--code-bg-color));
13
+ margin: 0.75rem -1.5rem;
228
14
  }
229
- }
230
-
231
- .shiki span {
232
- color: var(--shiki-light, inherit);
233
-
234
- .dark & {
235
- color: var(--shiki-dark, inherit);
236
- }
237
- }
238
15
 
239
- // narrow mobile
240
- @media (max-width: $MQMobileNarrow) {
241
- .theme-default-content {
242
- div[class*='language-'] {
243
- margin: 0.85rem -1.5rem;
244
- border-radius: 0;
16
+ // transitions for code notation highlighting
17
+ .line {
18
+ &.diff,
19
+ &.highlighted {
20
+ transition: background-color var(--t-color);
245
21
  }
246
22
  }
247
23
  }
@@ -1,5 +1,4 @@
1
1
  @use 'normalize';
2
2
  @use 'code';
3
- @use 'code-notation';
4
3
  @use 'custom-container';
5
4
  @use 'toc';
@@ -26,7 +26,7 @@ a {
26
26
  code {
27
27
  background-color: var(--c-bg-light);
28
28
  color: var(--c-text-lighter);
29
- font-family: var(--font-family-code);
29
+ font-family: var(--code-font-family);
30
30
  transition: background-color var(--t-color);
31
31
 
32
32
  p a & {
@@ -52,9 +52,6 @@ html.dark {
52
52
  --c-badge-danger: var(--c-danger);
53
53
  --c-badge-danger-text: #401416;
54
54
 
55
- // code blocks vars
56
- --code-hl-bg-color: #363b46;
57
-
58
55
  // plugin-docsearch
59
56
  /* stylelint-disable-next-line selector-class-pattern */
60
57
  .DocSearch {
@@ -72,24 +72,9 @@
72
72
  --t-color: 0.3s ease;
73
73
  --t-transform: 0.3s ease;
74
74
 
75
- // code blocks vars
76
- --code-bg-color: #282c34;
77
- --code-highlight-bg-color: rgb(0 0 0 / 66%);
78
- --code-highlight-error-bg-color: rgb(244 63 94 / 16%);
79
- --code-highlight-warning-bg-color: rgb(255 193 7 / 16%);
80
- --code-line-diff-remove-color: rgb(244 63 94 / 16%);
81
- --code-line-diff-remove-symbol-color: #e0575b;
82
- --code-line-diff-add-color: rgb(16 185 129 / 16%);
83
- --code-line-diff-add-symbol-color: #298459;
84
- --code-word-highlight-bg-color: rgb(0 0 0 / 20%);
85
- --code-word-highlight-border: #636363;
86
- --code-line-number-color: #9e9e9e;
87
- --code-line-number-wrapper-width: 3.5rem;
88
-
89
75
  // font vars
90
76
  --font-family: -apple-system, 'BlinkMacSystemFont', 'Segoe UI', roboto, oxygen,
91
77
  ubuntu, cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
92
- --font-family-code: consolas, monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
93
78
 
94
79
  // layout vars
95
80
  --navbar-height: 3.6rem;
@@ -1,4 +1,4 @@
1
- import { addViteOptimizeDepsExclude } from '@vuepress/helper';
1
+ import { addViteConfig, addViteOptimizeDepsExclude, chainWebpack, } from '@vuepress/helper';
2
2
  import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links';
3
3
  import { backToTopPlugin } from '@vuepress/plugin-back-to-top';
4
4
  import { copyCodePlugin } from '@vuepress/plugin-copy-code';
@@ -41,6 +41,45 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
41
41
  },
42
42
  clientConfigFile: path.resolve(__dirname, '../client/config.js'),
43
43
  extendsBundlerOptions: (bundlerOptions, app) => {
44
+ // FIXME: hide sass deprecation warning for mixed-decls
45
+ addViteConfig(bundlerOptions, app, {
46
+ css: {
47
+ preprocessorOptions: {
48
+ sass: {
49
+ logger: {
50
+ warn: (message, { deprecation, deprecationType }) => {
51
+ if (deprecation && deprecationType.id === 'mixed-decls')
52
+ return;
53
+ console.warn(message);
54
+ },
55
+ },
56
+ },
57
+ scss: {
58
+ logger: {
59
+ warn: (message, { deprecation, deprecationType }) => {
60
+ if (deprecation && deprecationType.id === 'mixed-decls')
61
+ return;
62
+ console.warn(message);
63
+ },
64
+ },
65
+ },
66
+ },
67
+ },
68
+ });
69
+ chainWebpack(bundlerOptions, app, (config) => {
70
+ config.module
71
+ .rule('scss')
72
+ .use('sass-loader')
73
+ .tap((options) => ({
74
+ api: 'modern-compiler',
75
+ ...options,
76
+ sassOptions: {
77
+ silenceDeprecations: ['mixed-decls'],
78
+ ...options.sassOptions,
79
+ },
80
+ }));
81
+ });
82
+ // ensure theme alias is not optimized by Vite
44
83
  addViteOptimizeDepsExclude(bundlerOptions, app, '@theme');
45
84
  },
46
85
  extendsPage: (page) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.37",
3
+ "version": "2.0.0-rc.39",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -37,23 +37,23 @@
37
37
  "templates"
38
38
  ],
39
39
  "dependencies": {
40
- "@vuepress/helper": "2.0.0-rc.37",
41
- "@vuepress/plugin-active-header-links": "2.0.0-rc.37",
42
- "@vuepress/plugin-back-to-top": "2.0.0-rc.37",
43
- "@vuepress/plugin-copy-code": "2.0.0-rc.37",
44
- "@vuepress/plugin-git": "2.0.0-rc.37",
45
- "@vuepress/plugin-links-check": "2.0.0-rc.37",
40
+ "@vuepress/helper": "2.0.0-rc.39",
41
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.39",
42
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.39",
43
+ "@vuepress/plugin-copy-code": "2.0.0-rc.39",
44
+ "@vuepress/plugin-git": "2.0.0-rc.38",
45
+ "@vuepress/plugin-links-check": "2.0.0-rc.39",
46
46
  "@vuepress/plugin-markdown-container": "2.0.0-rc.37",
47
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.37",
48
- "@vuepress/plugin-nprogress": "2.0.0-rc.37",
47
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.39",
48
+ "@vuepress/plugin-nprogress": "2.0.0-rc.39",
49
49
  "@vuepress/plugin-palette": "2.0.0-rc.37",
50
- "@vuepress/plugin-prismjs": "2.0.0-rc.37",
51
- "@vuepress/plugin-seo": "2.0.0-rc.37",
52
- "@vuepress/plugin-sitemap": "2.0.0-rc.37",
53
- "@vuepress/plugin-theme-data": "2.0.0-rc.37",
50
+ "@vuepress/plugin-prismjs": "2.0.0-rc.39",
51
+ "@vuepress/plugin-seo": "2.0.0-rc.39",
52
+ "@vuepress/plugin-sitemap": "2.0.0-rc.39",
53
+ "@vuepress/plugin-theme-data": "2.0.0-rc.39",
54
54
  "@vueuse/core": "^10.11.0",
55
- "sass": "^1.77.6",
56
- "vue": "^3.4.29"
55
+ "sass": "^1.77.8",
56
+ "vue": "^3.4.32"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "sass-loader": "^14.0.0",
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "3754bbda881d738a0dcfacc5172a70af67505013"
70
+ "gitHead": "5fc0740210318a083a02e8bfcd31fdde5b2f88ac"
71
71
  }
@@ -23,8 +23,12 @@
23
23
  const systemDarkMode =
24
24
  window.matchMedia &&
25
25
  window.matchMedia('(prefers-color-scheme: dark)').matches
26
- if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
26
+
27
+ if (userMode === 'light') {
28
+ document.documentElement.dataset.theme = 'light'
29
+ } else if (userMode === 'dark' || systemDarkMode) {
27
30
  document.documentElement.classList.toggle('dark', true)
31
+ document.documentElement.dataset.theme = 'dark'
28
32
  }
29
33
  </script>
30
34
  <!--vuepress-ssr-head-->
@@ -1,121 +0,0 @@
1
- // ------------ code notation highlighting ------------
2
- // matches `<span class="line xxxx" ></span>`
3
-
4
- div[class*='language-'] {
5
- // highlight lines and notation highlight
6
- // `!code highlight` and `!code hl` are the same:
7
- // - `// [\!code highlight]`
8
- // - `// [\!code hl]`
9
- // - `// [\!code highlight:3]`
10
- // - `// [\!code hl:3]`
11
- // It also has the style of error level,
12
- // covering the background color with 'warning' and 'error' classes.
13
- // - `// [\!code warning]`
14
- // - `// [\!code error]`
15
- // - `// [\!code warning:3]`
16
- // - `// [\!code error:3]`
17
- .line.highlighted {
18
- display: inline-block;
19
-
20
- width: 100%;
21
- margin: 0 -24px;
22
- padding: 0 24px;
23
-
24
- background-color: var(--code-highlight-bg-color);
25
-
26
- transition: background-color 0.5s;
27
-
28
- &.error {
29
- background-color: var(--code-highlight-error-bg-color);
30
- }
31
-
32
- &.warning {
33
- background-color: var(--code-highlight-warning-bg-color);
34
- }
35
- }
36
-
37
- // notation diff line
38
- // - class="diff add": `// [\!code ++]` or `// [\!code ++:3]`
39
- // - class="diff remove": `// [\!code --]` or `// [\!code --:3]`
40
- .line.diff {
41
- display: inline-block;
42
-
43
- width: 100%;
44
- margin: 0 -24px;
45
- padding: 0 24px;
46
-
47
- transition: background-color 0.5s;
48
-
49
- &::before {
50
- position: absolute;
51
- left: 10px;
52
- }
53
-
54
- &.remove {
55
- background-color: var(--code-line-diff-remove-color);
56
- opacity: 0.7;
57
-
58
- &::before {
59
- content: '-';
60
- color: var(--code-line-diff-remove-symbol-color);
61
- }
62
- }
63
-
64
- &.add {
65
- background-color: var(--code-line-diff-add-color);
66
-
67
- &::before {
68
- content: '+';
69
- color: var(--code-line-diff-add-symbol-color);
70
- }
71
- }
72
- }
73
-
74
- // notation focused lines
75
- // - `// [\!code focus]`
76
- // - `// [\!code focus:3]`
77
- .has-focused-lines .line:not(.has-focus) {
78
- opacity: 0.7;
79
- filter: blur(0.095rem);
80
- transition:
81
- filter 0.35s,
82
- opacity 0.35s;
83
- }
84
-
85
- &:hover .has-focused-lines .line:not(.has-focus) {
86
- opacity: 1;
87
- filter: blur(0);
88
- }
89
-
90
- // notation word highlight
91
- // - `// [\!code word:xxx]`
92
- // - `// [\!code word:xxx:3]`
93
- .highlighted-word {
94
- margin: -1px -2px;
95
- padding: 1px 2px;
96
- border: solid 1px var(--code-word-highlight-border);
97
- border-radius: 4px;
98
-
99
- background-color: var(--code-word-highlight-bg-color);
100
- }
101
-
102
- // whitespace
103
- .tab,
104
- .space {
105
- position: relative;
106
- }
107
-
108
- .tab::before,
109
- .space::before {
110
- position: absolute;
111
- opacity: 0.3;
112
- }
113
-
114
- .tab::before {
115
- content: '⇥';
116
- }
117
-
118
- .space::before {
119
- content: '·';
120
- }
121
- }