Skip to content

Commit 66222a2

Browse files
authored
Fix (color schemes): change selectors for color schemes (#3624)
* remove color scheme styles in editor if there are no color schemes * update selectors for color schemes * add compatibility for blocksy * coderabbit's qa fixes * fix generated css when there are no color schemes
1 parent a206c63 commit 66222a2

File tree

16 files changed

+166
-65
lines changed

16 files changed

+166
-65
lines changed

src/block/countdown/style.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "common";
2+
13
.stk-block.stk-block-countdown {
24
text-align: center;
35
&.stk-block-countdown--aligned {
@@ -61,7 +63,7 @@
6163
}
6264

6365
// These are styles added from the global color schemes.
64-
:where(.stk-has-color-schemes) {
66+
:where(#{$stk-has-color-schemes-selector}) {
6567
.stk-block-countdown__digit {
6668
color: var(--stk-accent-color);
6769
&:where(:hover) {

src/block/divider/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
// These are styles added from the global color schemes.
11-
:where(.stk-has-color-schemes) {
11+
:where(#{$stk-has-color-schemes-selector}) {
1212
.stk-block.stk-block-divider {
1313
hr.stk-block-divider__hr,
1414
.stk-block-divider__dot {

src/block/icon-list/style.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "common";
2+
13
// Important, we can't use flex since it causes issues with columns.
24
.stk-block-icon-list {
35
.stk-block-icon-list--grid:is(ul, ol) {
@@ -92,7 +94,7 @@
9294
}
9395
}
9496

95-
:where(.stk-has-color-schemes) {
97+
:where(#{$stk-has-color-schemes-selector}) {
9698
.stk-block-icon-list {
9799
--stk-icon-list-marker-color: var(--stk-accent-color);
98100
:where(.stk-block-icon-list-item) {

src/block/number-box/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ div.stk-block-number-box__text {
2121
}
2222

2323
// These are styles added from the global color schemes.
24-
:where(.stk-has-color-schemes) .stk-block-number-box.stk--has-shape {
24+
:where(#{$stk-has-color-schemes-selector}) .stk-block-number-box.stk--has-shape {
2525
.stk-block-number-box__container,
2626
div.stk-block-number-box__text {
2727
color: var(--stk-button-text-color, #fff);

src/block/price/style.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "common";
2+
13
.stk-block-price {
24
line-height: 1;
35
.stk-block-text {
@@ -12,6 +14,6 @@
1214
line-height: 0.7;
1315
}
1416

15-
:where(.stk-has-color-schemes .stk-block-price) .stk-block-text {
17+
:where(#{$stk-has-color-schemes-selector}) :where(.stk-block-price) .stk-block-text {
1618
color: var(--stk-text-color);
1719
}

src/block/progress-bar/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
}
4848

4949
// These are styles added from the global color schemes.
50-
:where(.stk-has-color-schemes) {
50+
:where(#{$stk-has-color-schemes-selector}) {
5151
.stk-block-progress-bar {
5252
--progress-color-1: var(--stk-accent-color);
5353
}

src/block/progress-circle/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
}
5656

5757
// These are styles added from the global color schemes.
58-
:where(.stk-has-color-schemes) {
58+
:where(#{$stk-has-color-schemes-selector}) {
5959
.stk-block-progress-circle {
6060
--progress-color-1: var(--stk-accent-color);
6161
}

src/block/table-of-contents/style.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import "common";
2+
13
// Important, we can't use flex since it causes issues with columns.
24
.stk-block-table-of-contents {
35
.stk-table-of-contents__table {
@@ -40,7 +42,7 @@
4042
}
4143

4244
// These are styles added from the global color schemes.
43-
:where(.stk-has-color-schemes) {
45+
:where(#{$stk-has-color-schemes-selector}) {
4446
.stk-block-table-of-contents {
4547
// Add this so that it inherits the color from global color schemes.
4648
::marker {

src/block/timeline/style.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323
// These are styles added from the global color schemes.
24-
:where(.stk-has-color-schemes) {
24+
:where(#{$stk-has-color-schemes-selector}) {
2525
.stk-block-timeline {
2626
--line-accent-bg-color: var(--stk-accent-color, #000);
2727
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// Use Blocksy theme colors as fallback defaults for container color schemes.
2+
// These defaults apply when the default container color scheme is unset, but background or custom schemes exist.
3+
:where(.stk--is-blocksy-theme.stk--has-container-scheme) {
4+
--stk-default-heading-color: var(--theme-heading-color, var(--theme-heading-2-color, var(--theme-headings-color)));
5+
--stk-default-link-color: var(--theme-link-initial-color);
6+
}

0 commit comments

Comments
 (0)