Skip to content

Commit 7b2e491

Browse files
authored
Refactor collapse components (hestiacp#4152)
* Rename .collapse component to .box-collapse * Remove dead .js class * Add new basic .collapse component
1 parent 965f91e commit 7b2e491

File tree

9 files changed

+844
-850
lines changed

9 files changed

+844
-850
lines changed

web/css/src/themes/dark.css

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,10 @@
355355
box-shadow: 0 1px 4px rgb(0 0 0 / 35%);
356356
}
357357

358-
/* Collapse component
358+
/* Box collapse component
359359
========================================================================== */
360360

361-
.collapse-header {
361+
.box-collapse-header {
362362
background: #454545;
363363
border-color: #505050;
364364
text-shadow: 0 1px rgb(0 0 0 / 40%);
@@ -368,6 +368,13 @@
368368
color: #fff;
369369
}
370370

371+
/* Collapse component
372+
========================================================================== */
373+
374+
.collapse-header {
375+
border-bottom-color: #484848;
376+
}
377+
371378
/* Units table
372379
========================================================================== */
373380

@@ -575,10 +582,6 @@
575582
color: #a2a2a2;
576583
}
577584

578-
.section-title {
579-
border-bottom-color: #484848;
580-
}
581-
582585
/* Buttons
583586
========================================================================== */
584587

web/css/src/themes/default.css

Lines changed: 48 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,18 +1719,6 @@
17191719
font-size: 0.8rem;
17201720
}
17211721

1722-
.section-title {
1723-
display: flex;
1724-
cursor: pointer;
1725-
justify-content: space-between;
1726-
align-items: center;
1727-
font-size: 1.05rem;
1728-
font-weight: 600;
1729-
padding-top: 28px;
1730-
padding-bottom: 12px;
1731-
border-bottom: 1px solid #ccc;
1732-
}
1733-
17341722
/* Modals
17351723
========================================================================== */
17361724

@@ -2070,17 +2058,17 @@
20702058
border-radius: var(--border-radius-base);
20712059
}
20722060

2073-
/* Collapse component
2061+
/* Box collapse component
20742062
========================================================================== */
20752063

2076-
.collapse {
2064+
.box-collapse {
20772065
}
20782066

2079-
.collapse[open] .collapse-header::after {
2067+
.box-collapse[open] .box-collapse-header::after {
20802068
transform: rotate(180deg);
20812069
}
20822070

2083-
.collapse-header {
2071+
.box-collapse-header {
20842072
background: linear-gradient(to bottom, rgb(247 247 247 / 100%) 0%, rgb(255 255 255 / 100%) 100%);
20852073
border: 1px solid #ddd;
20862074
text-shadow: 0 1px rgb(255 255 255 / 95%);
@@ -2117,7 +2105,7 @@
21172105
}
21182106
}
21192107

2120-
.collapse-content {
2108+
.box-collapse-content {
21212109
box-sizing: border-box; /* Work around box-sizing not inheriting in <details> in many browsers */
21222110
padding: 20px 20px 10px;
21232111

@@ -2126,6 +2114,49 @@
21262114
}
21272115
}
21282116

2117+
/* Collapse component
2118+
========================================================================== */
2119+
2120+
.collapse {
2121+
}
2122+
2123+
.collapse[open] .collapse-header::after {
2124+
content: "\f146";
2125+
}
2126+
2127+
.collapse-header {
2128+
display: flex;
2129+
justify-content: space-between;
2130+
align-items: center;
2131+
cursor: pointer;
2132+
color: var(--color-text-heading);
2133+
font-size: 1.05rem;
2134+
font-weight: 600;
2135+
padding-top: 28px;
2136+
padding-bottom: 12px;
2137+
border-bottom: 1px solid #ccc;
2138+
2139+
&:hover {
2140+
&::after {
2141+
color: var(--icon-color-maroon);
2142+
}
2143+
}
2144+
2145+
&::after {
2146+
font: var(--fa-font-solid);
2147+
content: "\f0fe";
2148+
color: #ddd;
2149+
display: inline-block;
2150+
text-rendering: auto;
2151+
-webkit-font-smoothing: antialiased;
2152+
}
2153+
}
2154+
2155+
.collapse-content {
2156+
box-sizing: border-box; /* Work around box-sizing not inheriting in <details> in many browsers */
2157+
padding-top: 15px;
2158+
}
2159+
21292160
/* Login
21302161
========================================================================== */
21312162

web/css/src/themes/flat.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,10 @@
105105
}
106106
}
107107

108-
/* Collapse component
108+
/* Box collapse component
109109
========================================================================== */
110110

111-
.collapse-header {
111+
.box-collapse-header {
112112
background: #fafafa;
113113
box-shadow: none;
114114
}

web/css/src/themes/vestia.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,10 +388,10 @@ h1 {
388388
border-radius: 0;
389389
}
390390

391-
/* Collapse component
391+
/* Box collapse component
392392
========================================================================== */
393393

394-
.collapse-header {
394+
.box-collapse-header {
395395
background: #fafafa;
396396
box-shadow: none;
397397
color: #444;

web/templates/pages/add_dns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
<?= _("Advanced Options") ?>
9090
</button>
9191
</div>
92-
<div x-cloak x-show="showAdvanced" id="advtable">
92+
<div x-cloak x-show="showAdvanced" id="advtable">
9393
<?php if ($_SESSION["DNS_CLUSTER_SYSTEM"] == "hestia-zone" && $_SESSION["SUPPORT_DNSSEC"] == "yes") { ?>
9494
<div class="form-check u-mb10">
9595
<input class="form-check-input" type="checkbox" name="v_dnssec" id="v_dnssec" value="yes" <?php if ($v_dnssec === 'yes'){ echo ' checked'; } ?>>

0 commit comments

Comments
 (0)