Skip to content

Commit

Permalink
navbar.css: cpprefjpアイコンをdataスキームで埋め込む
Browse files Browse the repository at this point in the history
できるだけ多くのブラウザで見られるように以下の記事 [1] を参考にした。

- [1] https://yukiyuriweb.com/2016/10/08/using-data-uri-scheme-for-svg-in-background-image-compatible-with-ie/

URL エンコードに関連する変換は以下を行う。

  # 行頭・行末の空白を削除
  /^$/d
  s/^[[:space:]]*//
  s/[[:space:]]*$/ /
  s/> $/>/

  # 文字の置換
  s/"/'/g
  s/</%3C/g
  s/>/%3E/g
  s/#/%23/g

その後に tr -d '\n' で改行を削除した。
  • Loading branch information
akinomyoga committed May 17, 2024
1 parent f2a4162 commit 93678a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion css/kunai/site/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ nav[role="navigation"] {
height: 0;
padding: 32px 32px 0 0;
margin: 0 4px 0 0;
background-image: url(https://cpprefjp.github.io/static/original-icons/cpprefjp-icon-v2.0-transparent.png);
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg width='26.000004mm' height='26.000004mm' viewBox='0 0 26.000004 26.000004' version='1.1' id='svg1' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cdefs id='defs1'%3E%3CclipPath clipPathUnits='userSpaceOnUse' id='clipPath12'%3E%3Crect style='fill:%232ca9e1;stroke:none;stroke-width:0.45729;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0' id='rect13' width='26' height='26' x='92.05806' y='113.9539' /%3E%3C/clipPath%3E%3C/defs%3E%3Cg id='layer1' transform='translate(-92.058062,-113.95391)'%3E%3Cg id='g12' clip-path='url(%23clipPath12)'%3E%3Cpath id='path2-6' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 92.803909,132.76018 -9.95492,5.62988 -9.85309,-5.80628 0.10185,-11.43616 9.95493,-5.62987 9.85308,5.80627 z' /%3E%3Cpath id='path2-2' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 137.01837,132.76018 -9.95492,5.62988 -9.85309,-5.80628 0.10185,-11.43616 9.95493,-5.62988 9.85308,5.80628 z' /%3E%3Cpath id='path2-9' style='fill:none;stroke:%2300a3af;stroke-width:2.11666;stroke-linecap:round;stroke-linejoin:round' d='m 112.76826,132.84545 -7.86126,4.70835 -9.038106,-5.38578 0.09342,-10.60799 9.131526,-5.22216 7.51379,4.6151' /%3E%3Cpath style='fill:%232ca9e1;stroke:none;stroke-width:0.945904;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0' id='path3-6' d='m 68.619675,152.01895 -1.306347,-4.85182 -4.851829,-1.30635 4.851829,-1.30635 1.306347,-4.85183 1.306346,4.85183 4.851829,1.30635 -4.851829,1.30635 z' transform='matrix(0.8119288,0,0,0.82328669,47.479406,6.8605971)' /%3E%3Cpath style='fill:%232ca9e1;stroke:none;stroke-width:0.945904;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-dashoffset:0' id='path3-6-1' d='m 68.619675,152.01895 -1.306347,-4.85182 -4.851829,-1.30635 4.851829,-1.30635 1.306347,-4.85183 1.306346,4.85183 4.851829,1.30635 -4.851829,1.30635 z' transform='matrix(0.8119288,0,0,0.82328669,55.018249,6.8605971)' /%3E%3Cg id='g5' transform='translate(0.20305)'%3E%3Cpath id='path2-6-4' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 103.65447,152.06483 -9.954911,5.62988 -9.85309,-5.80628 0.10185,-11.43616 9.95493,-5.62987 9.853071,5.80627 z' /%3E%3Cpath id='path2-5' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 125.7617,152.06483 -9.95492,5.62988 -9.85308,-5.80628 0.10184,-11.43616 9.95493,-5.62988 9.85308,5.80628 z' /%3E%3C/g%3E%3Cg id='g6' transform='translate(0.0998685)'%3E%3Cpath id='path2-6-4-9' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 103.75765,113.45553 -9.954908,5.62988 -9.85309,-5.80628 0.10185,-11.43616 9.95493,-5.629874 9.853068,5.806274 z' /%3E%3Cpath id='path2-5-1' style='fill:none;stroke:%2300a3af;stroke-width:1.05833;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none' d='m 125.86488,113.45553 -9.95492,5.62988 -9.85308,-5.80628 0.10184,-11.43616 9.95493,-5.629884 9.85308,5.806284 z' /%3E%3C/g%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
background-size: contain;
background-repeat: no-repeat;
}
Expand Down

0 comments on commit 93678a3

Please sign in to comment.