Skip to content

Scaled font size resets in the mobile mode. #9679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

.sd-boolean__thumb,
.sd-boolean__label {
@include useEditorFontSize;
display: block;
font-family: $font-editorfont-family;
font-weight: $font-editorfont-weight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
}

svg {
@include useEditorFontSize;
display: block;
width: multiply(1.5, $font-editorfont-size);
height: multiply(1.5, $font-editorfont-size);
Expand Down
14 changes: 10 additions & 4 deletions packages/survey-core/src/default-theme/blocks/sd-dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
}

.sd-dropdown__value {
@include useEditorFontSize;
width: 100%;
min-height: multiply(1.5, $font-editorfont-size);
overflow: hidden;
Expand Down Expand Up @@ -86,7 +85,6 @@

.sd-dropdown_chevron-button-svg,
.sd-dropdown_clean-button-svg {
@include useEditorFontSize;
width: multiply(1.5, $font-editorfont-size);
height: multiply(1.5, $font-editorfont-size);

Expand All @@ -105,7 +103,6 @@
}

.sd-dropdown__filter-string-input {
@include useEditorFontSize;
position: absolute;
left: 0;
top: 0;
Expand Down Expand Up @@ -186,7 +183,6 @@

.sv-dropdown-popup {
.sd-list__item-body {
@include useEditorFontSize;
line-height: multiply(1.5, $font-editorfont-size);
font-size: $font-editorfont-size;
font-weight: $font-editorfont-weight;
Expand All @@ -209,6 +205,16 @@
}
}

.sv-dropdown-popup.sv-popup--menu-tablet,
.sv-dropdown-popup.sv-popup--menu-phone {
.sd-list__item-body {
font-family: $font-family;
font-size: $font-size;
line-height: multiply(1.5, $font-size);
font-weight: 400;
}
}

.sv-dropdown-popup.sv-single-select-list.sv-popup--leave {
.sd-list__item.sv-list__item--selected {
.sv-list__item-body {
Expand Down
2 changes: 0 additions & 2 deletions packages/survey-core/src/default-theme/blocks/sd-file.scss
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
}

.sd-file__drag-area-placeholder {
@include useEditorFontSize;
text-align: center;
white-space: normal;
color: $font-questionplaceholder-color;
Expand Down Expand Up @@ -169,7 +168,6 @@
}

.sd-file--chose-btn--as .sd-file--answered .sd-file__actions-container {
@include useEditorFontSize;
inset-inline-end: calc(multiply(1.5, $font-editorfont-size) + calcSize(5));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
}

.sd-imagepicker__check-icon {
@include useEditorFontSize;
display: block;
width: multiply(1.5, $font-editorfont-size);
height: multiply(1.5, $font-editorfont-size);
Expand Down Expand Up @@ -108,7 +107,6 @@
}

.sd-imagepicker__text {
@include useEditorFontSize;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
margin-top: calcSize(1);
Expand Down
2 changes: 0 additions & 2 deletions packages/survey-core/src/default-theme/blocks/sd-input.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use "../variables.scss" as *;

.sd-input {
@include useEditorFontSize;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
Expand Down Expand Up @@ -165,7 +164,6 @@ textarea {
.sd-input[type="email"],
.sd-input[type="color"],
.sd-input[type="range"] {
@include useEditorFontSize;
box-sizing: content-box;
width: calc(100% - 4 * #{$base-unit});
height: multiply(1.5, $font-editorfont-size);
Expand Down
2 changes: 0 additions & 2 deletions packages/survey-core/src/default-theme/blocks/sd-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

.sd-item--disabled.sd-item--disabled .sd-item__decorator,
.sd-item__decorator {
@include useEditorFontSize;
display: flex;
align-items: center;
justify-content: center;
Expand Down Expand Up @@ -54,7 +53,6 @@
}

.sd-item__control-label {
@include useEditorFontSize;
font-family: $font-editorfont-family;
font-style: normal;
font-weight: $font-editorfont-weight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
}

.sd-action.sd-matrixdynamic__remove-btn .sd-action__icon {
@include useEditorFontSize;
width: multiply(1.5, $font-editorfont-size);
height: multiply(1.5, $font-editorfont-size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
line-height: 0;

span {
@include useEditorFontSize;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@
}

.sd-tab-item {
@include useEditorFontSize;
padding: calcSize(1) 0 calcSize(2);
display: flex;
-webkit-appearance: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
}

.sd-question__placeholder {
@include useEditorFontSize;
display: flex;
flex-direction: column;
align-items: center;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,6 @@ legend+sv-ng-rating-item+.sd-rating__item-smiley {
}

.sd-rating__item-text.sd-rating__item-text {
@include useEditorFontSize;
font-family: $font-editorfont-family;
font-weight: $font-editorfont-weight;
color: $font-questiontitle-color;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@use "../variables.scss" as *;

.sjs_sp_placeholder {
@include useEditorFontSize;
color: $font-questionplaceholder-color;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
Expand Down
3 changes: 0 additions & 3 deletions packages/survey-core/src/default-theme/blocks/sd-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@
}

.sd-table__cell {
@include useEditorFontSize;
font-weight: normal;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
Expand Down Expand Up @@ -248,7 +247,6 @@

.sd-table__cell--header {
span {
@include useEditorFontSize;
font-size: $font-editorfont-size;
line-height: multiply(1.5, $font-editorfont-size);
font-weight: $font-questiontitle-weight;
Expand Down Expand Up @@ -329,7 +327,6 @@
transition: background $transition-duration;

svg {
@include useEditorFontSize;
display: block;
width: multiply(1, $font-editorfont-size);
height: multiply(1, $font-editorfont-size);
Expand Down
4 changes: 0 additions & 4 deletions packages/survey-core/src/default-theme/blocks/sd-tagbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
}

.sd-tagbox_clean-button {
@include useEditorFontSize;
height: multiply(1.5, $font-editorfont-size);
padding: multiply(0.5, $font-editorfont-size);
margin: auto 0;
Expand Down Expand Up @@ -79,7 +78,6 @@
}

.sd-tagbox-item_clean-button-svg {
@include useEditorFontSize;
display: block;
padding: multiply(0.25, $font-editorfont-size);
width: multiply(1, $font-editorfont-size);
Expand Down Expand Up @@ -155,15 +153,13 @@
}

.sd-dropdown__hint-suffix.sd-tagbox__hint-suffix {
@include useEditorFontSize;
line-height: multiply(1.5, $font-editorfont-size);
height: 100%;
display: flex;
align-items: center;
}

.sd-dropdown__hint-prefix.sd-tagbox__hint-prefix {
@include useEditorFontSize;
line-height: multiply(1.5, $font-editorfont-size);
height: 100%;
display: flex;
Expand Down
4 changes: 2 additions & 2 deletions packages/survey-core/src/default-theme/blocks/sv-popup.scss
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,8 @@ sv-popup {

.sv-list__input {
color: $foreground-light;
font-size: max(16px, calcFontSize(1));
line-height: max(24px, calcLineHeight(1.5));
font-size: calcFontSize(1);
line-height: calcLineHeight(1.5);
font-family: $font-family;
padding: calcSize(0.5) calcSize(0.5) calcSize(0.5) calcSize(1);
}
Expand Down
2 changes: 0 additions & 2 deletions packages/survey-core/src/default-theme/blocks/sv-ranking.scss
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
}

.sv-ranking-item__index.sv-ranking-item__index {
@include useEditorFontSize;
display: flex;
flex-shrink: 0;
align-items: center;
Expand Down Expand Up @@ -116,7 +115,6 @@
}

.sv-ranking-item__text {
@include useEditorFontSize;
display: inline-block;
overflow: hidden;
text-overflow: ellipsis;
Expand Down
1 change: 0 additions & 1 deletion packages/survey-core/src/default-theme/default.m600.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
--sd-base-padding: calc(3 * #{$base-unit});
--sd-base-vertical-padding: calc(2 * #{$base-unit});
--sd-page-vertical-padding: calc(2 * #{$base-unit});
--sjs-mobile-font-editorfont-size: Max(16px, #{$font-default-editorfont-size});
}

.sd-root-modern {
Expand Down
9 changes: 1 addition & 8 deletions packages/survey-core/src/default-theme/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,9 @@ $font-editorfont-placeholdercolor: var(
--sjs-font-editorfont-placeholdercolor,
var(--sjs-general-forecolor-light, var(--foreground-light, #909090))
);
$font-default-editorfont-size: var(--sjs-font-editorfont-size, $font-size);
$font-editorfont-size: var(--sjs-font-editorfont-size, $font-size);
$base-unit: var(--sjs-base-unit, var(--base-unit, 8px));

//call @include useEditorFontSize before using this variable;
$font-editorfont-size: var(--sjs-internal-font-editorfont-size);

$sd-panel-normal-min-width: 496px;
$sd-panel-medium-min-width: 176px;

Expand Down Expand Up @@ -205,10 +202,6 @@ $transition-duration: var(--sjs-transition-duration, 150ms);
$ease-out: cubic-bezier(0, 0, 0.58, 1);
$reverse-ease-out: cubic-bezier(0.42, 0, 1, 1);

@mixin useEditorFontSize {
--sjs-internal-font-editorfont-size: var(--sjs-mobile-font-editorfont-size, #{$font-default-editorfont-size});
}

@function multiply($a, $b) {
@if $a ==1 {
$result: #{$b};
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.
2 changes: 1 addition & 1 deletion visualRegressionTests/tests/defaultV2/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ frameworks.forEach(framework => {
});
});

test("Mobile mode: input font-size is 16px", async (t) => {
test("Mobile mode: input font-size less 16px", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(400, 2000);
await ClientFunction(() => {
Expand Down