Skip to content

Commit 4f55eb5

Browse files
committed
[Style Settings]: Conditional dimming when certain style settings options are active/inactive
1 parent 563d56b commit 4f55eb5

4 files changed

Lines changed: 370 additions & 67 deletions

File tree

scss/flexcyon/others/_others.scss

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,6 @@ body.flexcyon-cust-str-hr {
143143
}
144144
}
145145

146-
body.flexcyon-flex-max-mode .hr::before,
147-
body.flexcyon-cust-str-hr .hr::before {
148-
background-color: var(--color-base-10);
149-
}
150-
151-
// body.theme-dark.flexcyon-flex-max-mode .hr::before,
152-
// body.theme-dark.flexcyon-cust-str-hr .hr::before {
153-
// background-color: var(--color-base-10);
154-
// }
155-
156-
// body.theme-light.flexcyon-flex-max-mode .hr::before,
157-
// body.theme-light.flexcyon-cust-str-hr .hr::before {
158-
// background-color: var(--color-base-00);
159-
// }
160-
161146
body.flexcyon-ribbon-top {
162147
--ribbon-width: max-content;
163148

scss/flexcyon/style_settings/_style_settings_editor.scss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,24 +1051,24 @@ settings:
10511051
value: flexcyon-status-right-align
10521052
- title: Text when hide until hover enabled
10531053
id: flexcyon-status-hide-until-hover-text
1054-
description: Text to show when hide until hover is enabled, do not leave empty
1054+
description: Text to show when hide until hover/hold is enabled, do not leave empty
10551055
type: variable-text
10561056
default: "Show status"
10571057
quotes: true
10581058
- title: Translation for showing status bar on hover
10591059
id: flexcyon-status-hide-until-hover-translation
1060-
description: Translation for showing status bar on hover, requires hide until hover to be enabled.
1060+
description: Translation for showing status bar on hover/hold.
10611061
type: variable-number
10621062
default: 80
10631063
format: vw
10641064
- title: Transition duration for showing status bar on hover
10651065
id: flexcyon-status-hide-hover-duration
1066-
description: Transition duration for showing status bar on hover, requires hide until hover to be enabled.
1066+
description: Transition duration for showing status bar on hover/hold.
10671067
type: variable-number
10681068
default: 325
10691069
format: ms
10701070
- title: Transition timing function for showing status bar on hover
1071-
description: Transition timing function for showing status bar on hover, requires hide until hover to be enabled.
1071+
description: Transition timing function for showing status bar on hover/hold.
10721072
id: flexcyon-status-hide-hover-function
10731073
type: variable-text
10741074
default: ease-out
@@ -1079,19 +1079,19 @@ settings:
10791079
default: false
10801080
- title: Reading Mode Text
10811081
id: flexcyon-status-reading-text
1082-
description: Text to display when in reading mode, needs use text instead of icons for mode status enabled.
1082+
description: Text to display when in reading mode.
10831083
type: variable-text
10841084
default: "READ"
10851085
quotes: true
10861086
- title: Source Mode Text
10871087
id: flexcyon-status-source-text
1088-
description: Text to display when in source mode, needs use text instead of icons for mode status enabled.
1088+
description: Text to display when in source mode.
10891089
type: variable-text
10901090
default: "SOURCE"
10911091
quotes: true
10921092
- title: Live Preview Mode Text
10931093
id: flexcyon-status-live-text
1094-
description: Text to display when in live preview mode, needs use text instead of icons for mode status enabled.
1094+
description: Text to display when in live preview mode.
10951095
type: variable-text
10961096
default: "LIVE"
10971097
quotes: true

scss/flexcyon/style_settings/_style_settings_styles.scss

Lines changed: 112 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ body.flexcyon-style-settings-dim-collapsed-headings {
9696
color: var(--color-blue);
9797
}
9898

99-
@mixin no-color-toggle-heading($heading_no) {
100-
.setting-item[data-id*="flexcyon-h#{$heading-no}-color"] {
99+
@mixin no-selector-dim($selector, $setting-name) {
100+
.style-settings-container .setting-item[data-id*="#{$selector}"] {
101101
cursor: not-allowed;
102102
opacity: var(--dimmed);
103103

@@ -106,16 +106,119 @@ body.flexcyon-style-settings-dim-collapsed-headings {
106106
}
107107

108108
&::before {
109-
content: "This setting requires coloured headings to be enabled first.";
109+
content: "This setting requires #{$setting-name} to be enabled first.";
110110
}
111111
}
112112
}
113113

114+
@mixin no-selector-dim-alt($selector, $setting-name) {
115+
.style-settings-container .setting-item[data-id*="#{$selector}"] {
116+
cursor: not-allowed;
117+
opacity: var(--dimmed);
118+
119+
.setting-item-control {
120+
pointer-events: none;
121+
}
122+
123+
&::before {
124+
content: "This setting requires #{$setting-name} to be disabled first.";
125+
}
126+
}
127+
}
128+
129+
$setting-name-1: "'Enable coloured headings'";
130+
114131
body:not(.flexcyon-coloured-headings) {
115-
@include no-color-toggle-heading(1);
116-
@include no-color-toggle-heading(2);
117-
@include no-color-toggle-heading(3);
118-
@include no-color-toggle-heading(4);
119-
@include no-color-toggle-heading(5);
120-
@include no-color-toggle-heading(6);
132+
@include no-selector-dim("flexcyon-h1-color", $setting-name-1);
133+
@include no-selector-dim("flexcyon-h2-color", $setting-name-1);
134+
@include no-selector-dim("flexcyon-h3-color", $setting-name-1);
135+
@include no-selector-dim("flexcyon-h4-color", $setting-name-1);
136+
@include no-selector-dim("flexcyon-h5-color", $setting-name-1);
137+
@include no-selector-dim("flexcyon-h6-color", $setting-name-1);
138+
}
139+
140+
$setting-name-2: "'Enable Relative Line Numbers'";
141+
142+
body:not(.flexcyon-enable-rel-nums) {
143+
@include no-selector-dim("flexcyon-no-num-with-relative", $setting-name-2);
144+
@include no-selector-dim("flexcyon-relative-num-only", $setting-name-2);
145+
@include no-selector-dim("flexcyon-select-relative-num", $setting-name-2);
146+
}
147+
148+
$setting-name-3: "'Enable Smooth Cursor'";
149+
150+
body:not(.flexcyon-enable-smooth-cursor) {
151+
@include no-selector-dim("flexcyon-cursor-duration", $setting-name-3);
152+
@include no-selector-dim("flexcyon-cursor-timing-fn", $setting-name-3);
153+
@include no-selector-dim("flexcyon-cursor-min-width", $setting-name-3);
154+
}
155+
156+
$setting-name-4: "Typewriter Mode";
157+
158+
body:not(.flexcyon-typewriter-mode) {
159+
@include no-selector-dim("flexcyon-typewriter-mode-opacity", $setting-name-4);
160+
}
161+
162+
$setting-name-5: "Writing Mode";
163+
164+
body:not(.flexcyon-editor-writing) {
165+
@include no-selector-dim(
166+
"flexcyon-editor-writing-indentation",
167+
$setting-name-5
168+
);
169+
}
170+
171+
$setting-name-6: "'Do not display inline title'";
172+
173+
body.flexcyon-no-inline-title {
174+
@include no-selector-dim-alt("inline-title-size", $setting-name-6);
175+
@include no-selector-dim-alt("inline-title-weight", $setting-name-6);
176+
@include no-selector-dim-alt("inline-title-line-height", $setting-name-6);
177+
}
178+
179+
$setting-name-7: "'Enable dimmed file extensions in file explorer'";
180+
181+
body:not(.flexcyon-file-exp-dimmed-file-exts-enabled) {
182+
@include no-selector-dim("flexcyon-exp-dimmed-nav-size", $setting-name-7);
183+
}
184+
185+
$setting-name-8: "'Enable Active File Indicator'";
186+
187+
body:not(.flexcyon-enable-active-indicator) {
188+
@include no-selector-dim("flexcyon-active-indicator", $setting-name-8);
189+
}
190+
191+
$setting-name-9: "'Rainbow folders' folder style";
192+
193+
body:not(.flexcyon-rainbow-folders) {
194+
@include no-selector-dim("flexcyon-is-bg-rainbow", $setting-name-9);
195+
}
196+
197+
$setting-name-10: "'Hide until hover' or 'Hide until hold'";
198+
199+
body:not(.flexcyon-status-hide-until-hover, .flexcyon-status-hide-until-hold) {
200+
@include no-selector-dim(
201+
"flexcyon-status-hide-until-hover-text",
202+
$setting-name-10
203+
);
204+
@include no-selector-dim(
205+
"flexcyon-status-hide-until-hover-translation",
206+
$setting-name-10
207+
);
208+
@include no-selector-dim(
209+
"flexcyon-status-hide-hover-duration",
210+
$setting-name-10
211+
);
212+
@include no-selector-dim(
213+
"flexcyon-status-hide-hover-function",
214+
$setting-name-10
215+
);
216+
}
217+
218+
$setting-name-11: "'Use text instead of icons for mode status'";
219+
220+
body:not(.flexcyon-status-text-mode) {
221+
@include no-selector-dim("flexcyon-status-reading-text", $setting-name-11);
222+
@include no-selector-dim("flexcyon-status-source-text", $setting-name-11);
223+
@include no-selector-dim("flexcyon-status-live-text", $setting-name-11);
121224
}

0 commit comments

Comments
 (0)