Skip to content
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

Validation: new material and fluent validation message styles #25537

Merged
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
37 changes: 36 additions & 1 deletion packages/devextreme/scss/widgets/base/_validation.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,46 @@
@mixin dx-base-validation($summary-color, $message-color, $message-bg-color) {

@mixin dx-base-validation($summary-color, $message-color, $message-bg-color, $border-radius) {
.dx-validationsummary-item {
color: $summary-color;
}

.dx-invalid-message > .dx-overlay-content {
color: $message-color;
background-color: $message-bg-color;
border-radius: $border-radius;
}
}

@mixin dx-modern-styles-validation(
$validation-message-font-size,
$validation-message-line-height,
$filled-texteditor-input-horizontal-padding,
$validation-message-padding,
$validationsummary-item-margin,
$validation-message-vertical-padding,
$validation-message-horizontal-padding,
) {
.dx-invalid-message > .dx-overlay-content {
padding: $validation-message-vertical-padding $validation-message-horizontal-padding;
line-height: $validation-message-line-height;
font-size: $validation-message-font-size;

.dx-invalid-message-top &,
.dx-invalid-message-bottom & {
.dx-editor-filled &,
.dx-editor-outlined {
padding-left: $filled-texteditor-input-horizontal-padding;
padding-right: $filled-texteditor-input-horizontal-padding;
}
}
}

.dx-validationsummary > .dx-validationsummary-item:not(:last-child) {
margin-bottom: $validationsummary-item-margin;
}

.dx-form-validation-summary {
margin-top: 20px;
}
}

Expand Down
54 changes: 15 additions & 39 deletions packages/devextreme/scss/widgets/fluent/validation/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,18 @@

// adduse
@use "../overlay";
@include dx-base-validation($validation-summary-color, $validation-message-color, $validation-message-background-color);

.dx-invalid-message > .dx-overlay-content {
background-color: transparent;
color: $validation-message-background-color;

.dx-invalid-message-top &,
.dx-invalid-message-bottom & {
.dx-editor-filled &,
.dx-editor-outlined {
padding-left: $fluent-filled-texteditor-input-horizontal-padding;
padding-right: $fluent-filled-texteditor-input-horizontal-padding;
}
}

.dx-invalid-message-top & {
padding: 0 0 $fluent-validation-message-padding 0;
}

.dx-invalid-message-right & {
padding: 0 0 0 $fluent-validation-message-padding;
}

.dx-invalid-message-bottom & {
padding: $fluent-validation-message-padding 0 0 0;
}

.dx-invalid-message-left & {
padding: 0 $fluent-validation-message-padding 0 0;
}
}

.dx-validationsummary > .dx-validationsummary-item:not(:last-child) {
margin-bottom: $fluent-validationsummary-item-margin;
}

.dx-form-validation-summary {
margin-top: 20px;
}
@include dx-base-validation(
$validation-summary-color,
$validation-message-color,
$validation-message-background-color,
$fluent-validation-overlay-border-radius
);
@include dx-modern-styles-validation(
$fluent-validation-message-font-size,
$fluent-validation-message-line-height,
$fluent-filled-texteditor-input-horizontal-padding,
$fluent-validation-message-padding,
$fluent-validationsummary-item-margin,
$fluent-validation-message-vertical-padding,
$fluent-validation-message-horizontal-padding,
);
12 changes: 12 additions & 0 deletions packages/devextreme/scss/widgets/fluent/validation/_sizes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@

$fluent-validation-message-padding: null !default;
$fluent-validationsummary-item-margin: null !default;
$fluent-validation-message-line-height: null !default;
$fluent-validation-message-horizontal-padding: null !default;

$fluent-validation-overlay-border-radius: 4px !default;
$fluent-validation-message-vertical-padding: 4px !default;
$fluent-validation-message-font-size: 12px !default;

@if $size == "default" {
$fluent-validation-message-padding: 6px !default;
$fluent-validationsummary-item-margin: 10px !default;

$fluent-validation-message-horizontal-padding: 8px !default;
$fluent-validation-message-line-height: 16px !default;
}

@else if $size == "compact" {
$fluent-validation-message-padding: 4px !default;
$fluent-validationsummary-item-margin: 6px !default;

$fluent-validation-message-horizontal-padding: 6px !default;
$fluent-validation-message-line-height: 12px !default;
}
10 changes: 1 addition & 9 deletions packages/devextreme/scss/widgets/generic/validation/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,4 @@

// adduse
@use "../overlay";
@include dx-base-validation($validation-summary-color, $validation-message-color, $validation-message-background-color);

.dx-invalid-message > .dx-overlay-content {
border-radius: $validation-overlay-border-radius;

.dx-editor-underlined & {
border-radius: 0;
}
}
@include dx-base-validation($validation-summary-color, $validation-message-color, $validation-message-background-color, $validation-overlay-border-radius);
49 changes: 10 additions & 39 deletions packages/devextreme/scss/widgets/material/validation/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,42 +8,13 @@

// adduse
@use "../overlay";
@include dx-base-validation($validation-summary-color, $validation-message-color, $validation-message-background-color);

.dx-invalid-message > .dx-overlay-content {
background-color: transparent;
color: $validation-message-background-color;

.dx-invalid-message-top &,
.dx-invalid-message-bottom & {
.dx-editor-filled &,
.dx-editor-outlined {
padding-left: $material-filled-texteditor-input-horizontal-padding;
padding-right: $material-filled-texteditor-input-horizontal-padding;
}
}

.dx-invalid-message-top & {
padding: 0 0 $material-validation-message-padding 0;
}

.dx-invalid-message-right & {
padding: 0 0 0 $material-validation-message-padding;
}

.dx-invalid-message-bottom & {
padding: $material-validation-message-padding 0 0 0;
}

.dx-invalid-message-left & {
padding: 0 $material-validation-message-padding 0 0;
}
}

.dx-validationsummary > .dx-validationsummary-item:not(:last-child) {
margin-bottom: $material-validationsummary-item-margin;
}

.dx-form-validation-summary {
margin-top: 20px;
}
@include dx-base-validation($validation-summary-color, $validation-message-color, $validation-message-background-color, $material-validation-overlay-border-radius);
@include dx-modern-styles-validation(
$material-validation-message-font-size,
$material-validation-message-line-height,
$material-filled-texteditor-input-horizontal-padding,
$material-validation-message-padding,
$material-validationsummary-item-margin,
$material-validation-message-vertical-padding,
$material-validation-message-horizontal-padding,
);
12 changes: 12 additions & 0 deletions packages/devextreme/scss/widgets/material/validation/_sizes.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@

$material-validation-message-padding: null !default;
$material-validationsummary-item-margin: null !default;
$material-validation-message-line-height: null !default;

$material-validation-message-horizontal-padding: null !default;
$material-validation-message-vertical-padding: 4px !default;
$material-validation-overlay-border-radius: 4px !default;
$material-validation-message-font-size: 12px !default;

@if $size == "default" {
$material-validation-message-padding: 6px !default;
$material-validationsummary-item-margin: 10px !default;

$material-validation-message-horizontal-padding: 8px !default;
$material-validation-message-line-height: 16px !default;
}

@else if $size == "compact" {
$material-validation-message-padding: 4px !default;
$material-validationsummary-item-margin: 6px !default;

$material-validation-message-horizontal-padding: 6px !default;
$material-validation-message-line-height: 12px !default;
}
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.
AlexanderMoiseev marked this conversation as resolved.
Show resolved Hide resolved
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