Skip to content

Commit 5c5caf8

Browse files
Adding fortawesome
1 parent c183cff commit 5c5caf8

File tree

6 files changed

+73
-2
lines changed

6 files changed

+73
-2
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@
6565
"devDependencies": {
6666
"@babel/core": "^7.21.3",
6767
"@babel/eslint-parser": "^7.21.3",
68+
"@fortawesome/fontawesome-svg-core": "^6.3.0",
69+
"@fortawesome/free-brands-svg-icons": "^6.3.0",
70+
"@fortawesome/free-solid-svg-icons": "^6.3.0",
71+
"@fortawesome/vue-fontawesome": "^3.0.3",
6872
"@rollup/plugin-alias": "^4.0.3",
6973
"@rollup/plugin-commonjs": "^24.0.1",
7074
"@rollup/plugin-json": "^6.0.0",

pnpm-lock.yaml

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import { createApp } from 'vue';
22
import App from './App.vue';
33
import CodeBlock from '@/index';
4+
import { library } from '@fortawesome/fontawesome-svg-core';
5+
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
6+
import { faCopyright, faHouse } from '@fortawesome/free-solid-svg-icons';
7+
import { faGithub, faNpm } from '@fortawesome/free-brands-svg-icons';
8+
9+
library.add({
10+
faCopyright,
11+
faGithub,
12+
faHouse,
13+
faNpm,
14+
});
415

516
createApp(App)
617
.use(CodeBlock, {
718
theme: 'neon-bunny',
819
})
20+
.component('fa-icon', FontAwesomeIcon)
921
.mount('#app');

src/plugin/CodeBlock.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ import UAParser from 'ua-parser-js';
9090
import { Props } from '@/types';
9191
9292
import StatusIcons from '@/plugin/StatusIcons.vue';
93-
const neonBunnyCarrotTheme = import.meta.glob('./theme/neon-bunny-carrot.css', { eager: true, as: 'raw' });
94-
const neonBunnyTheme = import.meta.glob('./theme/neon-bunny.css', { eager: true, as: 'raw' });
93+
const neonBunnyCarrotTheme = import.meta.glob('./themes/neon-bunny-carrot.css', { eager: true, as: 'raw' });
94+
const neonBunnyTheme = import.meta.glob('./themes/neon-bunny.css', { eager: true, as: 'raw' });
9595
const prismTheme = import.meta.glob('prismjs/themes/prism.css', { eager: true, as: 'raw' });
9696
const prismThemeCoy = import.meta.glob('prismjs/themes/prism-coy.css', { eager: true, as: 'raw' });
9797
const prismThemeDark = import.meta.glob('prismjs/themes/prism-dark.css', { eager: true, as: 'raw' });
@@ -483,5 +483,10 @@ function runCode(): void {
483483

484484
<style lang="scss" scoped>
485485
@import './styles/main';
486+
487+
.foo {
488+
display: block;
489+
z-index: 3;
490+
}
486491
</style>
487492

stylelint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports =
2424
// ---------------------------- Possible errors
2525
// Color
2626
'color-no-invalid-hex': true,
27+
'hue-degree-notation': 'number',
2728

2829
// Font family
2930
'font-family-no-duplicate-names': true,

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default defineConfig({
2121
fix: true,
2222
include: [
2323
'src/**/*.{css,scss,sass,vue}',
24+
'./src/components/**/*.{css,scss,sass,vue}',
2425
'./src/plugin/styles/*.{css,scss,sass}'
2526
],
2627
}),

0 commit comments

Comments
 (0)