Skip to content

Commit

Permalink
items font color (#7125)
Browse files Browse the repository at this point in the history
* resolve #7097 Martix column and row title should be affected with font-width property.

* resolve #7098 Survey texts should use another fore color

---------

Co-authored-by: OlgaLarina <olga.larina.dev@gmail.com>
  • Loading branch information
OlgaLarina and OlgaLarina committed Oct 12, 2023
1 parent ebcfc20 commit aabfe16
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/common-styles/sv-ranking.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,19 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
color: $foreground;
color: $font-questiontitle-color;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
margin: 0 calcSize(2);
}

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

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

Expand Down
6 changes: 3 additions & 3 deletions src/defaultV2-theme/blocks/sd-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@
font-weight: $font-editorfont-weight;
line-height: multiply(1.5, $font-editorfont-size);
font-size: $font-editorfont-size;
color: $font-editorfont-color;
color: $font-questiontitle-color;
white-space: normal;
word-break: break-word;
width: 100%;
text-align: left;
}

.sd-item--disabled .sd-item__control-label {
color: $foreground;
color: $font-questiontitle-color;
opacity: 0.25;
}

.sd-root--readonly .sd-item--disabled .sd-item__control-label {
color: $foreground;
color: $font-questiontitle-color;
}

.sd-item--error .sd-item__decorator {
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 @@ -322,7 +322,7 @@ legend+sv-ng-rating-item+.sd-rating__item-smiley {
.sd-rating__item-text.sd-rating__item-text {
font-family: $font-editorfont-family;
font-weight: $font-editorfont-weight;
color: $font-editorfont-color;
color: $font-questiontitle-color;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
display: inline-block;
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 52 additions & 0 deletions visualRegressionTests/tests/defaultV2/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,56 @@ frameworks.forEach(framework => {
await takeElementScreenshot("survey-theme-questiontitle-font-weight.png", Selector(".sd-root-modern"), t, comparer);
});
});

test("Check items colors", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(800, 1600);
await initSurvey(framework, {
"logoPosition": "right",
"showQuestionNumbers": "off",
"elements": [
{
"type": "checkbox",
"name": "question6",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
},
{
"type": "ranking",
"name": "question1",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
},
{
"type": "radiogroup",
"name": "question4",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
},
{
"type": "rating",
"name": "question5"
}
]
});
await ClientFunction(() => {
(<any>window).survey.applyTheme({
"cssVariables": {
"--sjs-font-questiontitle-color": "rgba(242, 2, 2, 1)",
"--sjs-font-questiontitle-size": "22px",
}
});
})();
await takeElementScreenshot("survey-theme-questiontitle-font-color-for-items.png", Selector(".sd-root-modern"), t, comparer);
});
});
});

0 comments on commit aabfe16

Please sign in to comment.