refactor: reduce custom CSS

This commit is contained in:
Cotes Chung 2024-04-21 00:00:50 +08:00
parent 63c51384df
commit 015d5670a1
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
4 changed files with 4 additions and 24 deletions

View file

@ -45,7 +45,7 @@
[...basicList].forEach((elem) => { [...basicList].forEach((elem) => {
const svgCode = elem.textContent; const svgCode = elem.textContent;
const backup = elem.parentElement; const backup = elem.parentElement;
backup.classList.add('unloaded'); backup.classList.add('d-none');
/* create mermaid node */ /* create mermaid node */
let mermaid = document.createElement('pre'); let mermaid = document.createElement('pre');
mermaid.classList.add('mermaid'); mermaid.classList.add('mermaid');

View file

@ -1,6 +1,6 @@
<!-- The Search results --> <!-- The Search results -->
<div id="search-result-wrapper" class="d-flex justify-content-center unloaded"> <div id="search-result-wrapper" class="d-flex justify-content-center d-none">
<div class="col-11 content"> <div class="col-11 content">
<div id="search-hints"> <div id="search-hints">
{% include_cached trending-tags.html %} {% include_cached trending-tags.html %}

View file

@ -14,8 +14,8 @@ const input = document.getElementById('search-input');
const hints = document.getElementById('search-hints'); const hints = document.getElementById('search-hints');
// CSS class names // CSS class names
const LOADED = 'loaded'; const LOADED = 'd-block';
const UNLOADED = 'unloaded'; const UNLOADED = 'd-none';
const FOCUS = 'input-focus'; const FOCUS = 'input-focus';
const FLEX = 'd-flex'; const FLEX = 'd-flex';

View file

@ -596,26 +596,6 @@ main {
/* --- Effects classes --- */ /* --- Effects classes --- */
.loaded {
display: block !important;
@at-root .d-flex#{&} {
display: flex !important;
}
}
.unloaded {
display: none !important;
}
.visible {
visibility: visible !important;
}
.hidden {
visibility: hidden !important;
}
.flex-grow-1 { .flex-grow-1 {
flex-grow: 1 !important; flex-grow: 1 !important;
} }