From 189f7e9195e985a2bf4fc28704847ff6491b52eb Mon Sep 17 00:00:00 2001 From: Antoine Llorca Date: Mon, 14 May 2018 10:58:58 -0700 Subject: [PATCH 1/2] fix align-right for switches --- packages/core/src/components/forms/_controls.scss | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/core/src/components/forms/_controls.scss b/packages/core/src/components/forms/_controls.scss index d2e8ccdd56..166061fa19 100644 --- a/packages/core/src/components/forms/_controls.scss +++ b/packages/core/src/components/forms/_controls.scss @@ -265,7 +265,7 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" background: $switch-background-color; width: $switch-width; height: $switch-height; - transition: background $pt-transition-duration $pt-transition-ease; + transition: background-color $pt-transition-duration $pt-transition-ease; &::before { display: block; @@ -334,6 +334,10 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" background-color: $switch-checked-background-color-disabled; } } + + &.#{$ns}-align-right { + padding-right: $switch-width + $pt-grid-size; + } } // right-aligned indicator is glued to the right side of the container @@ -390,6 +394,15 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" left: $switch-width-large - $switch-height-large + $switch-indicator-margin; } } + + &.#{$ns}-align-right { + padding-right: $switch-width-large + $pt-grid-size; + } + } + + &.#{$ns}-align-right { + padding-right: $control-indicator-size-large + $pt-grid-size; + padding-left: 0; } } From 9dc00304e8eb5c524f923599b10620d82c6a86fe Mon Sep 17 00:00:00 2001 From: Gilad Gray Date: Mon, 14 May 2018 12:07:12 -0700 Subject: [PATCH 2/2] move align-right modifier higher up --- .../core/src/components/forms/_controls.scss | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/core/src/components/forms/_controls.scss b/packages/core/src/components/forms/_controls.scss index 166061fa19..e154d37148 100644 --- a/packages/core/src/components/forms/_controls.scss +++ b/packages/core/src/components/forms/_controls.scss @@ -283,6 +283,10 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" } } + &.#{$ns}-align-right { + padding-right: $switch-width + $pt-grid-size; + } + input:checked ~ .#{$ns}-control-indicator { box-shadow: none; background-color: $switch-checked-background-color; @@ -334,10 +338,6 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" background-color: $switch-checked-background-color-disabled; } } - - &.#{$ns}-align-right { - padding-right: $switch-width + $pt-grid-size; - } } // right-aligned indicator is glued to the right side of the container @@ -365,6 +365,11 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" font-size: $control-indicator-size-large; } + &.#{$ns}-align-right { + padding-right: $control-indicator-size-large + $pt-grid-size; + padding-left: 0; + } + &.#{$ns}-checkbox input:checked ~ .#{$ns}-control-indicator::before { top: 1px; } @@ -399,11 +404,6 @@ $control-checked-background-color-active: nth(map-get($button-intents, "primary" padding-right: $switch-width-large + $pt-grid-size; } } - - &.#{$ns}-align-right { - padding-right: $control-indicator-size-large + $pt-grid-size; - padding-left: 0; - } } .#{$ns}-dark & {