From 7236e2e8f8f28aa2fff26b87c8d3e5709e238d73 Mon Sep 17 00:00:00 2001 From: mostafaei2002 Date: Sat, 1 Jun 2024 16:13:36 +0330 Subject: [PATCH] fix: organize css --- docs_theme/src/js/main.js | 2 +- docs_theme/src/scss/custom.scss | 72 ++++++++ .../src/scss/{styles.scss => main.scss} | 166 +----------------- docs_theme/src/scss/prettify.scss | 89 ++++++++++ 4 files changed, 164 insertions(+), 165 deletions(-) create mode 100644 docs_theme/src/scss/custom.scss rename docs_theme/src/scss/{styles.scss => main.scss} (56%) create mode 100644 docs_theme/src/scss/prettify.scss diff --git a/docs_theme/src/js/main.js b/docs_theme/src/js/main.js index 3211f4d24..660cf2b9d 100644 --- a/docs_theme/src/js/main.js +++ b/docs_theme/src/js/main.js @@ -11,7 +11,7 @@ import "../../node_modules/bootstrap/js/dist//modal"; // import "../../node_modules/bootstrap/js/dist/toast"; // import "../../node_modules/bootstrap/js/dist/tooltip"; -import "../scss/styles.scss"; +import "../scss/main.scss"; function setupPrettify() { const codeBlocks = document.querySelectorAll("pre code"); diff --git a/docs_theme/src/scss/custom.scss b/docs_theme/src/scss/custom.scss new file mode 100644 index 000000000..2969dc96f --- /dev/null +++ b/docs_theme/src/scss/custom.scss @@ -0,0 +1,72 @@ +a { + text-decoration: none; + + &:hover, + &:active { + text-decoration: underline; + } +} + +pre.prettyprint { + margin-bottom: 20px; +} + +code { + @extend .rounded; +} + +pre { + @extend .bg-body-tertiary; + @extend .rounded; +} + +pre code { + border: none; +} + +img { + @extend .img-fluid; +} + +.nav-link { + padding: 2px 15px 3px; +} + +.body-content { + padding-top: 70px; + padding-bottom: 70px; +} + +.badges { + display: flex; + align-items: center; + justify-content: end; + gap: 8px; +} + +.toclink { + color: #333; +} + +#table-of-contents { + @extend .rounded; + padding: 0.5rem; + margin-bottom: 1rem; +} + +.headerlink { + display: none; +} + +.promo { + @extend .d-none; + @extend .d-md-block; +} + +[data-bs-theme="dark"] .promo li a { + color: white !important; +} + +[data-bs-theme="dark"] [src="img/logo.png"] { + filter: invert(1) brightness(1.5) contrast(1.2); +} diff --git a/docs_theme/src/scss/styles.scss b/docs_theme/src/scss/main.scss similarity index 56% rename from docs_theme/src/scss/styles.scss rename to docs_theme/src/scss/main.scss index 74bd96994..766b3d1c0 100644 --- a/docs_theme/src/scss/styles.scss +++ b/docs_theme/src/scss/main.scss @@ -57,167 +57,5 @@ $code-color: #d14; // Utilities @import "../../node_modules/bootstrap/scss/utilities/api"; -// Custom Classes -a { - text-decoration: none; - - &:hover, - &:active { - text-decoration: underline; - } -} - -pre.prettyprint { - margin-bottom: 20px; -} - -code { - @extend .rounded; -} - -pre { - @extend .bg-body-tertiary; - @extend .rounded; -} - -pre code { - border: none; -} - -img { - @extend .img-fluid; -} - -.nav-link { - padding: 2px 15px 3px; -} - -.body-content { - padding-top: 70px; - padding-bottom: 70px; -} - -.badges { - display: flex; - align-items: center; - justify-content: end; - gap: 8px; -} - -.toclink { - color: #333; -} - -// Prettify Code -.com { - color: #93a1a1; -} -.lit { - color: #195f91; -} -.pun, -.opn, -.clo { - color: #93a1a1; -} -.fun { - color: #dc322f; -} -.str, -.atv { - color: #d14; -} -.kwd, -.prettyprint .tag { - color: #1e347b; -} -.typ, -.atn, -.dec, -.var { - color: teal; -} -.pln { - color: #48484c; -} - -.prettyprint { - padding: 20px; -} -.prettyprint.linenums { - box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; -} -[data-bs-theme="dark"] { - .com { - color: #9ea0a0; - } - - .lit { - color: #4d90fe; - } - - .pun, - .opn, - .clo { - color: #9ea0a0; - } - - .fun { - color: #fe6160; - } - - .str, - .atv { - color: #fea832; - } - - .kwd, - .prettyprint .tag { - color: #4d69a8; - } - - .typ, - .atn, - .dec, - .var { - color: #38a1a1; - } - - .pln { - color: #c8c8cc; - } -} - -/* Specify class=linenums on a pre to get line numbering */ -ol.linenums { - margin: 0 0 0 33px; /* IE indents via margin-left */ -} -ol.linenums li { - padding-left: 12px; - color: #bebec5; - line-height: 20px; - text-shadow: 0 1px 0 #fff; -} - -#table-of-contents { - @extend .rounded; - padding: 0.5rem; - margin-bottom: 1rem; -} - -.headerlink { - display: none; -} - -.promo { - @extend .d-none; - @extend .d-md-block; -} - -[data-bs-theme="dark"] .promo li a { - color: white !important; -} - -[data-bs-theme="dark"] [src="img/logo.png"] { - filter: invert(1) brightness(1.5) contrast(1.2); -} +@import "./prettify.scss"; +@import "./custom.scss"; diff --git a/docs_theme/src/scss/prettify.scss b/docs_theme/src/scss/prettify.scss new file mode 100644 index 000000000..3c010252c --- /dev/null +++ b/docs_theme/src/scss/prettify.scss @@ -0,0 +1,89 @@ +.com { + color: #93a1a1; +} +.lit { + color: #195f91; +} +.pun, +.opn, +.clo { + color: #93a1a1; +} +.fun { + color: #dc322f; +} +.str, +.atv { + color: #d14; +} +.kwd, +.prettyprint .tag { + color: #1e347b; +} +.typ, +.atn, +.dec, +.var { + color: teal; +} +.pln { + color: #48484c; +} + +.prettyprint { + padding: 20px; +} +.prettyprint.linenums { + box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; +} +[data-bs-theme="dark"] { + .com { + color: #9ea0a0; + } + + .lit { + color: #4d90fe; + } + + .pun, + .opn, + .clo { + color: #9ea0a0; + } + + .fun { + color: #fe6160; + } + + .str, + .atv { + color: #fea832; + } + + .kwd, + .prettyprint .tag { + color: #4d69a8; + } + + .typ, + .atn, + .dec, + .var { + color: #38a1a1; + } + + .pln { + color: #c8c8cc; + } +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin: 0 0 0 33px; /* IE indents via margin-left */ +} +ol.linenums li { + padding-left: 12px; + color: #bebec5; + line-height: 20px; + text-shadow: 0 1px 0 #fff; +}