Skip to content

Commit

Permalink
Theme bugs (#6647)
Browse files Browse the repository at this point in the history
* fix font weight style

* fix popup corners

* fix boolean question style with transparence background

* fix background color of rating item

* update boolean markup snapshot

* update etalons after "fix popup corners"

* fix tagbox items vertical alignment

* update etalon

---------

Co-authored-by: OlgaLarina <olga.larina.dev@gmail.com>
  • Loading branch information
OlgaLarina and OlgaLarina authored Aug 4, 2023
1 parent 05ed4e0 commit bd2139b
Show file tree
Hide file tree
Showing 30 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/common-styles/sv-popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sv-popup {

.sv-popup__container {
box-shadow: $shadow-large;
border-radius: calcCornerRadius(2);
position: absolute;
padding: 0;
}
Expand Down
2 changes: 2 additions & 0 deletions src/defaultCss/defaultV2Css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,8 @@ export var defaultV2Css = {
itemDisabled: "sd-boolean--disabled",
itemHover: "sd-boolean--allowhover",
label: "sd-boolean__label",
labelTrue: "sd-boolean__label--true",
labelFalse: "sd-boolean__label--false",
switch: "sd-boolean__switch",
disabledLabel: "sd-checkbox__label--disabled",
sliderText: "sd-boolean__thumb-text",
Expand Down
8 changes: 8 additions & 0 deletions src/defaultV2-theme/blocks/sd-boolean.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
border-radius: calcSize(12.5);
}

.sd-boolean.sd-boolean--checked .sd-boolean__label--true,
.sd-boolean:not(.sd-boolean--checked):not(sd-boolean--indeterminate) .sd-boolean__label--false {
color: transparent;
transition-duration: 0.15s;
transition-property: color;
transition-timing-function: linear;
}

.sd-boolean.sd-boolean--indeterminate .sd-boolean__switch {
display: none;
}
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
.sd-item__control-label {
font-family: $font-editorfont-family;
font-style: normal;
font-weight: normal;
font-weight: $font-editorfont-weight;
line-height: multiply(1.5, $font-editorfont-size);
font-size: $font-editorfont-size;
color: $font-editorfont-color;
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 @@ -40,7 +40,7 @@

.sd-rating__item {
position: relative;
background: transparent;
background: $background;
box-shadow: $shadow-small;
border-radius: calcSize(12.5);
white-space: nowrap;
Expand Down
1 change: 1 addition & 0 deletions src/defaultV2-theme/blocks/sd-tagbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.sv-tagbox__item {
position: relative;
display: flex;
align-items: center;
padding: calcSize(1) calcSize(1.5);
background-color: $primary;
border-radius: calcCornerRadius(0.5);
Expand Down
2 changes: 2 additions & 0 deletions src/question_boolean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ export class QuestionBooleanModel extends Question {
return new CssClassBuilder()
.append(this.cssClasses.label)
.append(this.cssClasses.disabledLabel, this.booleanValue === !checked || this.isReadOnly)
.append(this.cssClasses.labelTrue, !this.isIndeterminate && checked === true)
.append(this.cssClasses.labelFalse, !this.isIndeterminate && checked === false)
.toString();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/markup/snapshots/boolean-value-v2.snap.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<label class="sd-boolean sd-boolean--allowhover sd-boolean--checked">
<input aria-invalid="false" aria-label="Question title" aria-required="false" checked="" class="sd-boolean__control sd-visuallyhidden" id="testid0i" name="name" type="checkbox" value="true">
<div class="sd-boolean__thumb-ghost">
<span class="sd-boolean__label sd-checkbox__label--disabled">
<span class="sd-boolean__label sd-boolean__label--false sd-checkbox__label--disabled">
<span class="sv-string-viewer">No</span>
</span>
</div>
Expand All @@ -14,7 +14,7 @@
</span>
</div>
<div class="sd-boolean__thumb-ghost">
<span class="sd-boolean__label">
<span class="sd-boolean__label sd-boolean__label--true">
<span class="sv-string-viewer">Yes</span>
</span>
</div>
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.
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.

0 comments on commit bd2139b

Please sign in to comment.