Skip to content

Commit f913b23

Browse files
authored
fix header link (#4213)
* fix header link * optimize link.svg
1 parent 4de31ad commit f913b23

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

src/assets/link.svg

Lines changed: 1 addition & 0 deletions
Loading

src/styles/icons/link.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/styles/index.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ body {
2020
color: getColor(elephant);
2121
}
2222

23+
.header-link {
24+
display: inline-block;
25+
width: 22px;
26+
height: 22px;
27+
background-repeat: no-repeat;
28+
background-position: center;
29+
background-image: url('../assets/link.svg');
30+
background-size: contain;
31+
}
32+
[aria-hidden='true']:hover .header-link {
33+
visibility: visible;
34+
}
2335
a,
2436
button.as-link {
2537
color: $text-color-highlight;

webpack.common.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
33
const webpack = require('webpack');
4+
const h = require('hastscript');
45
const mdPlugins = [
56
require('remark-gfm'),
67
require('remark-slug'),
@@ -17,7 +18,12 @@ const mdPlugins = [
1718
[
1819
require('remark-autolink-headings'),
1920
{
20-
behavior: 'append'
21+
behavior: 'append',
22+
content(node) {
23+
return [
24+
h('span.header-link')
25+
];
26+
}
2127
}
2228
],
2329
[

0 commit comments

Comments
 (0)