File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed
Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ sh mithril/build.sh
3333sh panzoom/build.sh
3434sh prism/build.sh
3535sh remark/build.sh
36- sh themes/build.sh
36+ sh themes/build.sh $browser
3737
3838# copy files
3939mkdir -p tmp
Original file line number Diff line number Diff line change 11#! /bin/bash
22
3+ browser=$1
4+
35# set current working directory to directory of the shell script
46cd " $( dirname " $0 " ) "
57
@@ -49,4 +51,4 @@ npx csso --input cleanrmd/inst/resources/writ/writ.css --output ../../themes/wri
4951# after
5052rm -rf node_modules/ cleanrmd/
5153
52- node fix-themes.js
54+ node fix-themes.js $browser
Original file line number Diff line number Diff line change @@ -3,17 +3,22 @@ var fs = require('fs')
33var path = require ( 'path' )
44var themes = path . resolve ( __dirname , '../../themes/' )
55
6+ var prefix = {
7+ chrome : 'chrome' ,
8+ firefox : 'moz'
9+ } [ process . argv [ 2 ] || 'chrome' ]
10+
611fs . writeFileSync (
712 path . resolve ( themes , 'github.css' ) ,
813 fs . readFileSync ( path . resolve ( themes , 'github.css' ) , 'utf8' )
9- . replaceAll ( / m a s k - i m a g e : u r l \( " .* ?" \) / g, ' mask-image:url("chrome -extension://__MSG_@@extension_id__/content/anchor.svg")' ) ,
14+ . replaceAll ( / m a s k - i m a g e : u r l \( " .* ?" \) / g, ` mask-image:url("${ prefix } -extension://__MSG_@@extension_id__/content/anchor.svg")` ) ,
1015 'utf8'
1116)
1217
1318fs . writeFileSync (
1419 path . resolve ( themes , 'github-dark.css' ) ,
1520 fs . readFileSync ( path . resolve ( themes , 'github-dark.css' ) , 'utf8' )
16- . replaceAll ( / m a s k - i m a g e : u r l \( " .* ?" \) / g, ' mask-image:url("chrome -extension://__MSG_@@extension_id__/content/anchor.svg")' ) ,
21+ . replaceAll ( / m a s k - i m a g e : u r l \( " .* ?" \) / g, ` mask-image:url("${ prefix } -extension://__MSG_@@extension_id__/content/anchor.svg")` ) ,
1722 'utf8'
1823)
1924
Original file line number Diff line number Diff line change @@ -259,9 +259,18 @@ body._toc-right { padding-right: 300px !important; }
259259 content : ' ' ;
260260 display : inline-block;
261261 background-color : currentColor;
262- -webkit-mask-image : url ("chrome-extension://__MSG_@@extension_id__/content/anchor.svg" );
263262 mask-image : url ("chrome-extension://__MSG_@@extension_id__/content/anchor.svg" );
264263}
264+ @supports (-moz-appearance : none) {
265+ .markdown-theme h1 : hover .anchor .octicon-link : before ,
266+ .markdown-theme h2 : hover .anchor .octicon-link : before ,
267+ .markdown-theme h3 : hover .anchor .octicon-link : before ,
268+ .markdown-theme h4 : hover .anchor .octicon-link : before ,
269+ .markdown-theme h5 : hover .anchor .octicon-link : before ,
270+ .markdown-theme h6 : hover .anchor .octicon-link : before {
271+ mask-image : url ("moz-extension://__MSG_@@extension_id__/content/anchor.svg" );
272+ }
273+ }
265274
266275.markdown-theme h1 .octicon-link ,
267276.markdown-theme h2 .octicon-link ,
You can’t perform that action at this time.
0 commit comments