From fb579411266b0ce24eca20de9cc72ae664b2b4fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schubert?= Date: Fri, 3 Mar 2017 14:37:34 +0100 Subject: [PATCH 1/3] Fixed circle styles... ...to fit a column width < $rowHeight --- src/Day/Day.scss | 56 +++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/src/Day/Day.scss b/src/Day/Day.scss index 8d6ba3614..e4d7f9c7c 100644 --- a/src/Day/Day.scss +++ b/src/Day/Day.scss @@ -3,12 +3,11 @@ @mixin circle() { content: ''; position: absolute; - top: 50%; - left: 50%; - width: $rowHeight - 4px; - height: $rowHeight - 4px; - margin-top: -0.5 * ($rowHeight - 4px); - margin-left: -0.5 * ($rowHeight - 4px); + top: 2px; + right: 2px; + bottom: 2px; + left: 2px; + max-width: $rowHeight - 4px; border-radius: 50%; } @@ -47,31 +46,32 @@ } &:first-child { - position: relative; + position: relative; } &.today { - position: relative; - z-index: 2; + position: relative; + z-index: 2; - > span { - color: $textColor; - } + > span { + color: $textColor; + } - &.disabled > span { - color: $textColorDisabled; - } + &.disabled > span { + color: $textColorDisabled; + } - &:before { - @include circle(); - box-shadow: inset 0 0 0 1px; - z-index: -1; - } + &:before { + @include circle(); + box-shadow: inset 0 0 0 1px; + z-index: -1; + } - &.disabled:before { - box-shadow: inset 0 0 0 1px #BBB; - } + &.disabled:before { + box-shadow: inset 0 0 0 1px #BBB; + } } + &.selected { position: relative; @@ -132,11 +132,10 @@ &:after { content: ''; position: absolute; - top: 50%; - width: ($rowHeight - 4px) / 2; - height: $rowHeight - 4px; - margin-top: -0.5 * ($rowHeight - 4px); - box-shadow: inset $rowHeight $rowHeight; + top: 2px; + width: 50%; + bottom: 2px; + box-shadow: inset 0 $rowHeight - 4px; } } @@ -170,7 +169,6 @@ left: 0; right: 0; width: 100%; - margin-left: 0; display: flex; justify-content: center; align-items: center; From af94883c9f31c4ccb28a0afcdf4f8162c1bd15a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schubert?= Date: Fri, 3 Mar 2017 14:52:28 +0100 Subject: [PATCH 2/3] Fixed circle size for flexible size setting --- src/Day/Day.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Day/Day.scss b/src/Day/Day.scss index e4d7f9c7c..c770c76d0 100644 --- a/src/Day/Day.scss +++ b/src/Day/Day.scss @@ -7,6 +7,7 @@ right: 2px; bottom: 2px; left: 2px; + max-height: $rowHeight - 4px; max-width: $rowHeight - 4px; border-radius: 50%; } @@ -168,7 +169,7 @@ .selection { left: 0; right: 0; - width: 100%; + max-width: 100%; display: flex; justify-content: center; align-items: center; From eee5c7c0abc7865d1d25dd4808345e3ee752ad95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Schubert?= Date: Fri, 3 Mar 2017 14:54:19 +0100 Subject: [PATCH 3/3] Fixed circle position for flexible size setting --- src/Day/Day.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Day/Day.scss b/src/Day/Day.scss index c770c76d0..9b264e231 100644 --- a/src/Day/Day.scss +++ b/src/Day/Day.scss @@ -10,6 +10,7 @@ max-height: $rowHeight - 4px; max-width: $rowHeight - 4px; border-radius: 50%; + margin: auto; } .root {