Skip to content

Commit

Permalink
Fix panel paddings
Browse files Browse the repository at this point in the history
  • Loading branch information
dk981234 committed Aug 23, 2023
1 parent 7cb458a commit f61e5a0
Show file tree
Hide file tree
Showing 61 changed files with 24 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/defaultCss/defaultV2Css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ export var defaultV2Css = {
contentLeft: "sd-question__content--left",
titleNumInline: "sd-element__title--num-inline",
titleLeftRoot: "sd-question--left",
titleTopRoot: "sd-question--top",
titleOnAnswer: "sd-question__title--answer",
titleOnError: "sd-question__title--error",
title: "sd-title sd-element__title sd-question__title",
Expand Down
22 changes: 16 additions & 6 deletions src/defaultV2-theme/blocks/sd-element.scss
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@
}
}

&>.sd-element__header--location-top {
margin-top: 0;
}

&.sd-element--with-frame {
padding-top: 0;
padding-bottom: 0;
Expand All @@ -210,10 +214,6 @@
padding-bottom: calcSize(2);
border-radius: $panel-corner-radius;
}

&>.sd-element__header--location-top {
margin-top: 0;
}
}

&>.sd-element__header:focus-within,
Expand All @@ -237,6 +237,17 @@
}
}

&.sd-question--table:not(.sd-element--collapsed) {
&.sd-question--top {
margin-top: calcSize(-1);

&>.sd-question__erbox--above-question {
margin-top: calcSize(1);
margin-bottom: var(--sd-base-vertical-padding);
}
}
}

&.sd-element--collapsed {

&>.sd-element__header:hover,
Expand Down Expand Up @@ -300,5 +311,4 @@
border-radius: $panel-corner-radius;
box-shadow: none;
background-color: transparent;
}

}
3 changes: 1 addition & 2 deletions src/defaultV2-theme/blocks/sd-panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
}

.sd-panel.sd-panel--as-page {

&>.sd-panel__header.sd-panel__header {
padding-top: 0;
padding-bottom: 0;
Expand Down Expand Up @@ -60,5 +59,5 @@
}

.sd-panel__content {
padding-top: var(--sd-base-vertical-padding);
padding-top: var(--sd-base-padding);
}
9 changes: 2 additions & 7 deletions src/defaultV2-theme/blocks/sd-paneldynamic.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,14 @@
display: none;
}

padding-top: calc(0.5 * var(--sd-base-vertical-padding) + #{$base-unit});
padding-top: var(--sd-base-vertical-padding);

&>.sd-panel__title {
color: $foreground-light;
}
}
}

.sd-question__content:first-child>.sd-paneldynamic {
&>.sd-paneldynamic__panel-wrapper>.sd-panel>.sd-panel__header {
padding-top: var(--sd-base-vertical-padding);
}
}

.sd-paneldynamic__separator {
display: block;
position: absolute;
Expand Down Expand Up @@ -135,6 +129,7 @@
padding-bottom: var(--sd-base-padding);
}
}

.sd-paneldynamic__buttons-container .sd-action-bar {
width: 100%;
margin: 0 calcSize(-3);
Expand Down
8 changes: 2 additions & 6 deletions src/defaultV2-theme/blocks/sd-question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}

.sd-question__erbox--above-question {
margin-bottom: calc(var(--sd-base-vertical-padding) - #{$base-unit});
margin-bottom: var(--sd-base-vertical-padding);
}

.sd-question__erbox--below-question {
Expand All @@ -47,6 +47,7 @@
}

.sd-question__header--location-top {
margin-top: calc(-1 * 0.25 * var(--sd-base-vertical-padding));
padding-bottom: calc(0.5 * var(--sd-base-vertical-padding));
}

Expand All @@ -63,11 +64,6 @@

&>.sd-question__erbox--above-question {
margin-top: calc(-1 * var(--sd-base-padding));
margin-bottom: var(--sd-base-vertical-padding);
}

&>.sd-question__header--location-top {
margin-top: calcSize(-1);
}

&>.sd-question__content>.sd-question__header--location--bottom {
Expand Down
2 changes: 1 addition & 1 deletion src/defaultV2-theme/blocks/sd-row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}

.sd-page__row.sd-row--multiple {
padding: var(--sd-base-vertical-padding) var(--sd-base-padding) var(--sd-base-padding) 0;
padding: var(--sd-base-padding) var(--sd-base-padding) var(--sd-base-padding) 0;
margin-left: 0;
width: 100%;

Expand Down
1 change: 1 addition & 0 deletions src/question.ts
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,7 @@ export class Question extends SurveyElement<Question>
.append(this.isFlowLayout && !this.isDesignMode
? cssClasses.flowRoot
: cssClasses.mainRoot)
.append(cssClasses.titleTopRoot, this.hasTitleOnTop)
.append(cssClasses.titleLeftRoot, !this.isFlowLayout && this.hasTitleOnLeft)
.append(cssClasses.hasError, this.errors.length > 0)
.append(cssClasses.small, !this.width)
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/complex-question.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/panel-expand.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/panel-in-row.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/panel-invisible.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/panel.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified visualRegressionTests/tests/defaultV2/etalons/survey-compact.png
Binary file modified visualRegressionTests/tests/defaultV2/etalons/tagbox-focused.png

0 comments on commit f61e5a0

Please sign in to comment.