From f7a028db6f7df1b8676b274a1e1e22357d5577d7 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Wed, 19 Jul 2023 17:03:10 +0200 Subject: [PATCH] feat: enable SASS Signed-off-by: Matej Focko --- docusaurus.config.js | 3 ++- package.json | 4 ++- src/css/{custom.css => custom.scss} | 37 ++++++++++++++++++++++++++ yarn.lock | 41 +++++++++++++++++++++++++++-- 4 files changed, 81 insertions(+), 4 deletions(-) rename src/css/{custom.css => custom.scss} (64%) diff --git a/docusaurus.config.js b/docusaurus.config.js index c88bb10..3d93b9b 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -84,7 +84,7 @@ const config = { blog: false, theme: { customCss: [ - require.resolve("./src/css/custom.css"), + require.resolve("./src/css/custom.scss"), require.resolve("./src/css/cascadia_code.css"), ], }, @@ -109,6 +109,7 @@ const config = { rehypePlugins: [katex], }, ], + "docusaurus-plugin-sass", ], stylesheets: [ diff --git a/package.json b/package.json index ad4989e..7d0df89 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@docusaurus/theme-mermaid": "^2.4.1", "@mdx-js/react": "^1.6.22", "clsx": "^1.2.1", + "docusaurus-plugin-sass": "^0.2.4", "dotenv": "^16.0.3", "hast-util-is-element": "^1.1.0", "prism": "^4.1.2", @@ -26,7 +27,8 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "rehype-katex": "^5.0.0", - "remark-math": "^3.0.1" + "remark-math": "^3.0.1", + "sass": "^1.63.6" }, "devDependencies": { "@docusaurus/module-type-aliases": "^2.4.1" diff --git a/src/css/custom.css b/src/css/custom.scss similarity index 64% rename from src/css/custom.css rename to src/css/custom.scss index 1d90e32..8a76304 100644 --- a/src/css/custom.css +++ b/src/css/custom.scss @@ -42,3 +42,40 @@ pre, code, kbd, var, tt { [data-theme='dark'] img[src$='#gh-light-mode-only'] { display: none; } + +.button--outline { + &:focus { + --ifm-button-background-color: var(--ifm-button-border-color); + } + + &.button--primary:focus { + --ifm-button-color: var(--ifm-font-color-base-inverse); + } +} + +.button__icon { + width: 18px; + height: 18px; + display: inline-block; + margin-right: 0.5rem; + position: relative; + top: 3px; + fill: var(--ifm-button-color); + + .button--secondary & { + fill: var(--ifm-color-gray-900); + + [data-theme="dark"] & { + fill: var(--ifm-font-color-base); + } + } + + .button--outline:hover &, + .button--outline:active &, + .button--outline:focus &, + .button--outline.button--active & { + [data-theme="dark"] & { + fill: var(--ifm-font-color-base-inverse); + } + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index c25ab19..7f33b07 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2929,7 +2929,7 @@ cheerio@^1.0.0-rc.12: parse5 "^7.0.0" parse5-htmlparser2-tree-adapter "^7.0.0" -chokidar@^3.4.2, chokidar@^3.5.3: +"chokidar@>=3.0.0 <4.0.0", chokidar@^3.4.2, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -3837,6 +3837,13 @@ dns-packet@^5.2.2: dependencies: "@leichtgewicht/ip-codec" "^2.0.1" +docusaurus-plugin-sass@^0.2.4: + version "0.2.4" + resolved "https://registry.yarnpkg.com/docusaurus-plugin-sass/-/docusaurus-plugin-sass-0.2.4.tgz#a9e95b08a35df977b7a782329db7483917c8e617" + integrity sha512-r9bLXW6X2z64bzQUQZB1SxmNlGvSO9swTFALgiMjr/1O4FRDti6BseU4Sw2mlZkYvVQTq8cJMJIP6w7z/5We8Q== + dependencies: + sass-loader "^10.1.1" + dom-converter@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -4904,6 +4911,11 @@ immer@^9.0.7: resolved "https://registry.yarnpkg.com/immer/-/immer-9.0.21.tgz#1e025ea31a40f24fb064f1fef23e931496330176" integrity sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA== +immutable@^4.0.0: + version "4.3.1" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.1.tgz#17988b356097ab0719e2f741d56f3ec6c317f9dc" + integrity sha512-lj9cnmB/kVS0QHsJnYKD1uo3o39nrbKxszjnqS9Fr6NB7bZzW45U6WSGBPKXDL/CvDKqDNPA4r3DoDQ8GTxo2A== + import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" @@ -5343,6 +5355,11 @@ kleur@^3.0.3: resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== +klona@^2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.6.tgz#85bffbf819c03b2f53270412420a4555ef882e22" + integrity sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA== + latest-version@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/latest-version/-/latest-version-5.1.0.tgz#119dfe908fe38d15dfa43ecd13fa12ec8832face" @@ -7042,6 +7059,26 @@ safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +sass-loader@^10.1.1: + version "10.4.1" + resolved "https://registry.yarnpkg.com/sass-loader/-/sass-loader-10.4.1.tgz#bea4e173ddf512c9d7f53e9ec686186146807cbf" + integrity sha512-aX/iJZTTpNUNx/OSYzo2KsjIUQHqvWsAhhUijFjAPdZTEhstjZI9zTNvkTTwsx+uNUJqUwOw5gacxQMx4hJxGQ== + dependencies: + klona "^2.0.4" + loader-utils "^2.0.0" + neo-async "^2.6.2" + schema-utils "^3.0.0" + semver "^7.3.2" + +sass@^1.63.6: + version "1.63.6" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.63.6.tgz#481610e612902e0c31c46b46cf2dad66943283ea" + integrity sha512-MJuxGMHzaOW7ipp+1KdELtqKbfAWbH7OLIdoSMnVe3EXPMTmxTmlaZDCTsgIpPCs3w99lLo9/zDKkOrJuT5byw== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + sax@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" @@ -7314,7 +7351,7 @@ sort-css-media-queries@2.1.0: resolved "https://registry.yarnpkg.com/sort-css-media-queries/-/sort-css-media-queries-2.1.0.tgz#7c85e06f79826baabb232f5560e9745d7a78c4ce" integrity sha512-IeWvo8NkNiY2vVYdPa27MCQiR0MN0M80johAYFVxWWXQ44KU84WNxjslwBHmc/7ZL2ccwkM7/e6S5aiKZXm7jA== -source-map-js@^1.0.2: +"source-map-js@>=0.6.2 <2.0.0", source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==