Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit 386ab72

Browse files
Updating sass to use @use instead of @import
1 parent a23f5fb commit 386ab72

File tree

3 files changed

+41
-26
lines changed

3 files changed

+41
-26
lines changed

src/components/Sections/ThemesSection.vue

+26-20
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
(<code>neon-bunny</code>,
1717
<code>neon-bunny-carrot</code>) built into the component that are based
1818
off of my own VSCode
19-
<a :href="links.neonBunnyTheme" target="_blank">Neon Bunny Theme</a>.
19+
<a
20+
:href="links.neonBunnyTheme"
21+
target="_blank"
22+
>Neon Bunny Theme</a>.
2023
</p>
2124

2225
<CodeBlock
@@ -32,28 +35,24 @@
3235
<p>
3336
Another other is to use the main
3437
<a
35-
:href="
36-
selectedLibrary.id === 'prism'
37-
? prismLinks.homepage
38-
: highlightJsLinks.homepage
39-
"
38+
:href="selectedLibrary.id === 'prism'
39+
? prismLinks.homepage
40+
: highlightJsLinks.homepage
41+
"
4042
target="_blank"
41-
>{{ selectedLibrary.label }}</a
42-
>
43+
>{{ selectedLibrary.label }}</a>
4344
themes. If you use the component to load the theme, you just need to set
4445
the
4546
<a href="#props-theme-option">theme</a> prop to the desired theme. When
4647
you load it this way, the component will use a <code>fetch</code> call
4748
to load them themes from the
4849
<a
49-
:href="
50-
selectedLibrary.id === 'prism'
51-
? prismLinks.cdn
52-
: highlightJsLinks.cdn
53-
"
50+
:href="selectedLibrary.id === 'prism'
51+
? prismLinks.cdn
52+
: highlightJsLinks.cdn
53+
"
5454
target="_blank"
55-
>jsDelivr CDN</a
56-
>. Fetching the {{ selectedLibrary.label }} themes from a CDN was the
55+
>jsDelivr CDN</a>. Fetching the {{ selectedLibrary.label }} themes from a CDN was the
5756
best method I could figure out at this time to dynamically load the
5857
themes, while making it easier for you to use them. You can also link to
5958
another CDN of your choice.
@@ -92,7 +91,10 @@
9291

9392
<p v-if="selectedLibrary.id === 'prism'">
9493
Themes from their
95-
<a :href="prismLinks.themes" target="_blank">Prism themes</a>
94+
<a
95+
:href="prismLinks.themes"
96+
target="_blank"
97+
>Prism themes</a>
9698
repository can be used this way as well.
9799
<span v-html="tabIconCopy"></span>
98100
</p>
@@ -115,11 +117,15 @@
115117
<CodeBlock
116118
:code="examples[selectedLibrary.id].importCss"
117119
:highlightjs="selectedLibrary.id === 'highlightjs'"
118-
label="Using import (css/sass/scss)"
120+
label="Using <code>@use</code> (css/sass/scss)"
119121
lang="html"
120122
:prismjs="selectedLibrary.id === 'prism'"
121123
:theme="selectedTheme"
122-
/>
124+
>
125+
<template #label>
126+
Using <code>@use</code> (css/sass/scss)
127+
</template>
128+
</CodeBlock>
123129
</div>
124130
</div>
125131
</template>
@@ -153,7 +159,7 @@ const examples = {
153159
theme="neon-bunny-carrot"
154160
/>`,
155161
importCss: `<style>
156-
@import 'prismjs/themes/prism-coy.css';
162+
@use 'prismjs/themes/prism-coy.css';
157163
<\/style>`,
158164
importJs: `<script setup>
159165
import 'prismjs/themes/prism-coy.css';
@@ -190,7 +196,7 @@ const examples = {
190196
theme="neon-bunny-carrot"
191197
/>`,
192198
importCss: `<style>
193-
@import 'highlight.js/styles/base16/onedark.css';
199+
@use 'highlight.js/styles/base16/onedark.css';
194200
<\/style>`,
195201
importJs: `<script setup>
196202
import 'highlight.js/styles/base16/onedark.css';

src/plugin/CodeBlock.vue

+14-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
<template>
2-
<div class="v-code-block v-code-block--mb-5" :class="codeBlockClasses">
2+
<div
3+
class="v-code-block v-code-block--mb-5"
4+
:class="codeBlockClasses"
5+
>
36
<div
47
v-if="label || tabs || slots.label || slots.tabs"
58
class="v-code-block--header"
69
:style="headerStyles"
710
>
8-
<div class="v-code-block--label v-code-block--pb-1" :class="labelClasses">
11+
<div
12+
class="v-code-block--label v-code-block--pb-1"
13+
:class="labelClasses"
14+
>
915
<template v-if="slots.label">
1016
<slot name="label" />
1117
</template>
1218
<template v-else>{{ props.label }}</template>
1319
</div>
1420

15-
<div class="v-code-block--tabs" :style="tabGroupStyle">
21+
<div
22+
class="v-code-block--tabs"
23+
:style="tabGroupStyle"
24+
>
1625
<template v-if="slots.tabs">
1726
<slot name="tabs" />
1827
</template>
@@ -658,7 +667,7 @@ function runCode(): void {
658667
</script>
659668

660669
<style lang="scss">
661-
@import './styles/utilities';
670+
@use './styles/utilities';
662671
663672
.v-code-block {
664673
&- {
@@ -676,5 +685,5 @@ function runCode(): void {
676685
</style>
677686

678687
<style lang="scss" scoped>
679-
@import './styles/main';
688+
@use './styles/main';
680689
</style>

src/plugin/StatusIcons.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ defineProps({
5151
</script>
5252

5353
<style lang="scss">
54-
@import './styles/themeStyles';
54+
@use './styles/themeStyles';
5555
</style>

0 commit comments

Comments
 (0)