Skip to content

Commit 40b40c8

Browse files
committed
Enhance module styling: improve collapse behavior for modules
1 parent 4826b40 commit 40b40c8

File tree

1 file changed

+65
-7
lines changed

1 file changed

+65
-7
lines changed

popup-page-styles/popup-components.css

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,62 @@ Key areas:
1717
*/
1818

1919
:root {
20+
/* Base tokens */
2021
--section-header-bg: #f5f5f5;
2122
--manual-bg: #f8f8f8;
2223
--code-bg: #efefef;
2324
--text-muted: #666;
25+
26+
/* Module tokens */
27+
--ocp-module-gap: 8px;
28+
--ocp-module-radius: 4px;
29+
--ocp-module-pad: 10px;
30+
--ocp-module-border: 1px solid var(--border-color);
31+
--ocp-module-header-bg: var(--section-header-bg, #f5f5f5);
32+
}
33+
34+
/* ===== Module container & layout ===== */
35+
#modulesSection > .section-content {
36+
/* Controls inter-module spacing */
37+
}
38+
#modulesSection > .section-content > .ocp-module {
39+
margin-bottom: var(--ocp-module-gap);
40+
}
41+
#modulesSection > .section-content > .ocp-module:last-child {
42+
margin-bottom: 0;
43+
}
44+
45+
/* ===== Module internals (no outer spacing here) ===== */
46+
.ocp-module__header {
47+
background: var(--ocp-module-header-bg);
48+
border-radius: var(--ocp-module-radius);
49+
padding: var(--ocp-module-pad);
50+
margin-bottom: 0; /* keep gaps on the container, not here */
51+
display: flex;
52+
align-items: center;
53+
justify-content: space-between;
54+
}
55+
56+
.ocp-module__content {
57+
padding: var(--ocp-module-pad);
58+
border: var(--ocp-module-border);
59+
border-radius: 0 0 var(--ocp-module-radius) var(--ocp-module-radius);
60+
}
61+
62+
/* Collapse behavior (state class on section) */
63+
.ocp-module:not(.expanded) .ocp-module__content {
64+
display: none !important;
65+
padding: 0 !important;
66+
border: 0 !important;
67+
margin: 0 !important;
68+
}
69+
70+
/* Optional: arrow rotation */
71+
.ocp-module.expanded .toggle-icon { transform: rotate(90deg); }
72+
73+
/* Specific module tweaks (only if necessary) */
74+
.ocp-module--danger .ocp-module__header { /* example modifier */
75+
/* different bg, etc. */
2476
}
2577

2678
/* ------------------------------------------------------------------------- */
@@ -323,7 +375,8 @@ Key areas:
323375
}
324376

325377
/* Ensure crossChatModule content is removed from layout when collapsed */
326-
#crossChatModule:not(.expanded) .section-content {
378+
#crossChatModule:not(.expanded) .section-content,
379+
#crossChatModule:not(.expanded) .ocp-module__content {
327380
display: none !important;
328381
padding: 0 !important;
329382
border: 0 !important;
@@ -336,7 +389,8 @@ Key areas:
336389

337390
/* Strong collapse: when a collapsible is not expanded, fully remove the content from layout.
338391
This eliminates any visual borders/padding/margins that might otherwise linger. */
339-
.collapsible:not(.expanded) .section-content {
392+
.collapsible:not(.expanded) .section-content,
393+
.ocp-module:not(.expanded) .ocp-module__content {
340394
display: none !important;
341395
padding: 0 !important;
342396
border: 0 !important;
@@ -438,15 +492,18 @@ Key areas:
438492
/* ---------- Consistent spacing for Modules area only ---------- */
439493

440494
/* Ensure uniform spacing between modules in all states */
441-
#modulesSection > .section-content > .collapsible {
442-
margin-bottom: 8px; /* consistent gap */
495+
#modulesSection > .section-content > .collapsible,
496+
#modulesSection > .section-content > .ocp-module {
497+
margin-bottom: var(--ocp-module-gap); /* consistent gap using variable */
443498
}
444-
#modulesSection > .section-content > .collapsible:last-child {
499+
#modulesSection > .section-content > .collapsible:last-child,
500+
#modulesSection > .section-content > .ocp-module:last-child {
445501
margin-bottom: 0; /* no extra space after the last module */
446502
}
447503

448504
/* Remove the bottom margin from individual headers in Modules only */
449-
#modulesSection > .section-content > .collapsible .section-header {
505+
#modulesSection > .section-content > .collapsible .section-header,
506+
#modulesSection > .section-content > .ocp-module .ocp-module__header {
450507
margin-bottom: 0;
451508
}
452509

@@ -466,7 +523,8 @@ Key areas:
466523

467524
/* Inline Profile Selector: in collapsed state, content is fully removed (redundant with global rule but explicit).
468525
In expanded state, normal styles apply. */
469-
#inlineProfileSelectorModule:not(.expanded) .section-content {
526+
#inlineProfileSelectorModule:not(.expanded) .section-content,
527+
#inlineProfileSelectorModule:not(.expanded) .ocp-module__content {
470528
display: none !important;
471529
padding: 0 !important;
472530
border: 0 !important;

0 commit comments

Comments
 (0)