Skip to content

Commit

Permalink
forecolor from advanced settings (#7136)
Browse files Browse the repository at this point in the history
* work for #7099 set question title font variable

* work for #7099 set question description font variable

* work for #7099 set editor placeholdercolor font color variable

* work for #7099 fix colors

* work for #7099 update etalons

---------

Co-authored-by: OlgaLarina <[email protected]>
  • Loading branch information
OlgaLarina and OlgaLarina authored Oct 14, 2023
1 parent 6d6061d commit 774fedc
Show file tree
Hide file tree
Showing 27 changed files with 103 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/common-styles/sv-list.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
padding-block: calcSize(1);
padding-inline-end: calcSize(8);
padding-inline-start: calcSize(2);
color: $foreground;
color: $font-questiontitle-color;
font-weight: normal;
font-size: calcFontSize(1);
line-height: calcLineHeight(1.5);
Expand Down Expand Up @@ -147,7 +147,7 @@ li:focus .sv-list__item.sv-list__item--selected {
.sv-multi-select-list .sv-list__item.sv-list__item--selected:hover {
.sv-list__item-body {
background-color: $primary-light;
color: $foreground;
color: $font-questiontitle-color;
font-weight: 400;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/common-styles/sv-ranking.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
align-items: center;
justify-content: center;
background-color: $primary-light;
color: $foreground;
color: $font-questiontitle-color;
font-size: calcFontSize(1);
border-radius: 100%;
border: calcSize(0.25) solid transparent;
Expand Down Expand Up @@ -117,7 +117,7 @@
}

.sv-ranking-item--disabled .sv-ranking-item__text {
color: $font-questiontitle-color;
color: $font-questiondescription-color;
opacity: 0.25;
}

Expand Down Expand Up @@ -282,7 +282,7 @@
}

.sv-ranking__container-placeholder {
color: $foreground-dim-light;
color: var(--sjs-font-questiondescription-color, #{$foreground-dim-light});
@include defaultFont;
white-space: break-spaces;
display: flex;
Expand All @@ -304,7 +304,7 @@
}

.sv-ranking__containers-divider {
background: $border-inside;
background: var(--sjs-border-default, #{$border-inside});
}

.sv-ranking__container--from {
Expand Down
4 changes: 2 additions & 2 deletions src/defaultV2-theme/blocks/sd-action.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
}

use {
fill: $foreground-light;
fill: $font-questiondescription-color;
}
}

svg.sd-action--icon {
fill: $foreground-light;
fill: $font-questiondescription-color;
}

.sd-action:disabled,
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-boolean.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
font-family: $font-editorfont-family;
font-weight: $font-editorfont-weight;
font-size: $font-editorfont-size;
color: $foreground-light;
color: $font-editorfont-placeholdercolor;
line-height: multiply(1.5, $font-editorfont-size);
padding: calcSize(1) calcSize(3);
}
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
}

.sv-dropdown_select-wrapper use {
fill: $foreground-light;
fill: $font-editorfont-placeholdercolor;
}

.sd-dropdown {
Expand Down
4 changes: 2 additions & 2 deletions src/defaultV2-theme/blocks/sd-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
.sd-file--answered .sd-file__actions-container {
z-index: 2;
margin-top: 0;
gap: calcSize(1)
gap: calcSize(1);
}

.sd-file--answered .sd-file__actions-container {
Expand Down Expand Up @@ -178,7 +178,7 @@
a {
display: block;
text-decoration: none;
color: $foreground;
color: $font-questiontitle-color;
white-space: normal;
word-break: break-all;
width: calcSize(12);
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-imagepicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
margin-top: calcSize(1);
color: $foreground;
color: $font-questiontitle-color;
}

.sd-imagepicker__no-image {
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-multipletext.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
border-right: 1px solid $border;
word-break: break-word;
white-space: normal;
color: $foreground-light;
color: $font-editorfont-placeholdercolor;
}

.sd-multipletext__item {
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-paneldynamic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
.sd-paneldynamic__progress-text {
font-size: $font-questiontitle-size;
line-height: multiply(1.5, $font-questiontitle-size);
color: $foreground-light;
color: $font-questiondescription-color;
margin: 0;
margin-right: calcSize(3);
}
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-rating.scss
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ legend+sv-ng-rating-item+.sd-rating__item-smiley {
margin-top: calcSize(1.25);
margin-bottom: calcSize(1.25);
border: 2px solid transparent;
color: $foreground-light;
color: $font-questiondescription-color;
}

&.sd-rating__min-text {
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
display: block;
width: multiply(1, $font-editorfont-size);
height: multiply(1, $font-editorfont-size);
fill: $foreground-light;
fill: $font-questiondescription-color;
}

&:hover {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 86 additions & 3 deletions visualRegressionTests/tests/defaultV2/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,29 @@ frameworks.forEach(framework => {
});
});

test("Check items colors", async (t) => {
test("Check items size & colors", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 1600);
await t.resizeWindow(800, 2000);
await initSurvey(framework, {
"logoPosition": "right",
"showQuestionNumbers": "off",
"elements": [
{
type: "dropdown",
name: "cars",
choices: [
"Ford",
"Vauxhall",
"Volkswagen",
"Nissan",
"Audi",
"Mercedes-Benz",
"BMW",
"Peugeot",
"Toyota",
"Citroen"
]
},
{
"type": "checkbox",
"name": "question6",
Expand Down Expand Up @@ -191,18 +207,85 @@ frameworks.forEach(framework => {
{
"type": "rating",
"name": "question5"
},
{
type: "imagepicker",
name: "choosepicture",
showLabel: true,
choices: [{
value: "lion",
imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/lion.jpg"
},
{
value: "giraffe",
imageLink: "https://surveyjs.io/Content/Images/examples/image-picker/giraffe.jpg"
},
]
}
]
});
await ClientFunction(() => {
(<any>window).survey.applyTheme({
"cssVariables": {
"--sjs-font-questiontitle-color": "rgba(242, 2, 2, 1)",
"--sjs-font-questiontitle-size": "22px",
"--sjs-font-editorfont-size": "24px"
}
});
})();
await takeElementScreenshot("survey-theme-questiontitle-font-color-for-items.png", Selector(".sd-root-modern"), t, comparer);

await t.click(".sd-dropdown");
await takeElementScreenshot("survey-theme-questiontitle-font-color-for-dropdown-list-items.png", Selector(".sv-popup.sv-dropdown-popup .sv-popup__container"), t, comparer);
});
});

test("Check input element placeholder", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 1600);
await initSurvey(framework, {
"logoPosition": "right",
"pages": [
{
"name": "page1",
"elements": [
{
"type": "boolean",
"name": "question1"
},
{
"type": "multipletext",
"name": "question2",
"items": [
{
"name": "text1"
},
{
"name": "text2"
}
]
},
{
"type": "dropdown",
"name": "question3",
"defaultValue": "Item 1",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
}
]
}
]
});
await ClientFunction(() => {
(<any>window).survey.applyTheme({
"cssVariables": {
"--sjs-font-editorfont-placeholdercolor": "rgba(66, 123, 215, 1)"
}
});
})();
await takeElementScreenshot("survey-theme-editorfont-placeholdercolor.png", Selector(".sd-root-modern"), t, comparer);
});
});
});

0 comments on commit 774fedc

Please sign in to comment.