Skip to content

Commit

Permalink
Addressing review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
daveyholler committed Aug 25, 2020
1 parent 4950f1b commit d9a2483
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 57 deletions.
2 changes: 1 addition & 1 deletion src/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
@include euiFormControlText;

border: none;
border-radius: 0;
border-radius: $euiFormControlBorderRadius;
padding: $euiFormControlPadding;

@if ($includeStates) {
Expand Down
1 change: 1 addition & 0 deletions src/global_styling/variables/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $euiFormControlHeight: $euiSizeXXL !default;
$euiFormControlCompressedHeight: $euiSizeXL !default;
$euiFormControlPadding: $euiSizeM !default;
$euiFormControlCompressedPadding: $euiSizeS !default;
$euiFormControlBorderRadius: 0;
$euiFormControlCompressedBorderRadius: $euiBorderRadius / 2 !default;

$euiRadioSize: $euiSize !default;
Expand Down
60 changes: 11 additions & 49 deletions src/themes/eui-amsterdam/global_styling/mixins/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,54 +25,16 @@
}
}

// 2. Override invalid state with focus state.
@mixin euiFormControlFocusStyle($borderOnly: false) {
// sass-lint:disable-block indentation, empty-args
background-color: tintOrShade($euiColorEmptyShade, 0%, 40%);
background-image: euiFormControlGradient();
background-size: 100% 100%; // 1

@mixin euiFormControlStyle($borderOnly: false, $includeStates: true, $includeSizes: true) {
@include euiFormControlSize($includeAlternates: $includeSizes);
@include euiFormControlDefaultShadow;
@include euiFormControlText;

border: none;
border-radius: $euiBorderRadius;
padding: $euiFormControlPadding;

@if ($includeStates) {
&:invalid { // 2
@include euiFormControlInvalidStyle;
}

&:focus { // 2
@include euiFormControlFocusStyle;
}

&:disabled {
@include euiFormControlDisabledStyle;
}

&[readOnly] {
@include euiFormControlReadOnlyStyle;
}

// Needs to be set for autofill
// sass-lint:disable-block no-vendor-prefixes
&:-webkit-autofill {
-webkit-text-fill-color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);

~ .euiFormControlLayoutIcons {
color: lightOrDarkTheme($euiColorDarkestShade, $euiColorLightShade);
}
}

}

@if ($includeSizes) {
&--compressed {
@include euiFormControlStyleCompressed($borderOnly, $includeStates);
}

&--inGroup {
// sass-lint:disable-block no-important
box-shadow: none !important;
}
@if ($borderOnly) {
box-shadow: inset 0 0 0 1px $euiFormBorderColor;
} @else {
box-shadow:
inset 0 0 0 1px $euiFormBorderColor;
}
}
}
3 changes: 2 additions & 1 deletion src/themes/eui-amsterdam/global_styling/variables/_form.scss
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
$euiFormControlCompressedBorderRadius: $euiBorderRadiusSmall;
$euiFormControlBorderRadius: $euiBorderRadius;
$euiFormControlCompressedBorderRadius: $euiBorderRadiusSmall;
13 changes: 7 additions & 6 deletions src/themes/eui-amsterdam/overrides/_form_control_layout.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
$leftSideRadius: $euiBorderRadius 0 0 $euiBorderRadius;
$rightSideRadius: 0 $euiBorderRadius $euiBorderRadius 0;
$leftSideRadiusSmall: $euiFormControlCompressedBorderRadius 0 0 $euiFormControlCompressedBorderRadius;
$rightSideRadiusSmall: 0 $euiFormControlCompressedBorderRadius $euiFormControlCompressedBorderRadius 0;

.euiFormControlLayout {
$leftSideRadius: $euiBorderRadius 0 0 $euiBorderRadius;
$rightSideRadius: 0 $euiBorderRadius $euiBorderRadius 0;
$leftSideRadiusSmall: $euiFormControlCompressedBorderRadius 0 0 $euiFormControlCompressedBorderRadius;
$rightSideRadiusSmall: 0 $euiFormControlCompressedBorderRadius $euiFormControlCompressedBorderRadius 0;
}

.euiFormControlLayout--group {
border-radius: $euiBorderRadius;
Expand Down Expand Up @@ -76,4 +77,4 @@ $rightSideRadiusSmall: 0 $euiFormControlCompressedBorderRadius $euiFormControlCo
border-radius: $rightSideRadiusSmall;
}
}
}
}

0 comments on commit d9a2483

Please sign in to comment.