From a0e918a5a506c86997f341eaa8b7b46e0bfee3cf Mon Sep 17 00:00:00 2001 From: Rick Banister Date: Fri, 5 Feb 2016 14:06:04 -0500 Subject: [PATCH] Global Notices: fixed notice__action for global notices The fade background was overflowing the round corners and the font-size was incorrect and the padding was off. I also reorganized the notices stylesheet to make more sense. --- client/components/global-notices/style.scss | 8 ++ client/components/notice/style.scss | 115 ++++++++++---------- 2 files changed, 66 insertions(+), 57 deletions(-) diff --git a/client/components/global-notices/style.scss b/client/components/global-notices/style.scss index 3fb4ceb32a030..30dece279da2b 100644 --- a/client/components/global-notices/style.scss +++ b/client/components/global-notices/style.scss @@ -35,6 +35,7 @@ @include breakpoint( ">660px" ) { border-radius: 20px; display: inline-flex; + overflow: hidden; margin-bottom: 24px; } } @@ -54,6 +55,13 @@ } } +.global-notices .notice a.notice__action { + @include breakpoint( ">660px" ) { + font-size: 14px; + padding: 9px 16px; + } +} + .global-notices .notice__dismiss { @include breakpoint( ">660px" ) { diff --git a/client/components/notice/style.scss b/client/components/notice/style.scss index c7acad8220d95..a2823188c158b 100644 --- a/client/components/notice/style.scss +++ b/client/components/notice/style.scss @@ -58,6 +58,64 @@ } } +.notice__button { + cursor: pointer; + margin-left: 0.428em; +} + +// "X" for dismissing a notice +.notice__dismiss { + display: flex; + padding: 11px 16px; + cursor: pointer; + color: $gray; + + @include breakpoint( ">660px" ) { + padding: 13px 16px; + } + + &:hover, + &:focus { + color: $gray-dark; + } + + .notice & { + color: $gray; + opacity: 0.85; + + &:hover, + &:focus { + opacity: 1; + } + } +} + +// specificity for general `a` elements within notice is too great +.notice a.notice__action { + background: rgba( 0, 0, 0, 0.2 ); + box-sizing: border-box; + color: $white; + cursor: pointer; + display: flex; + align-items: center; + font-size: 15px; + font-weight: 400; + margin-left: auto; // forces the element to the right; + padding: 13px 16px; + text-decoration: none; + white-space: nowrap; + + .gridicon { + margin-left: 8px; + opacity: 0.7; + } + + &:hover, + &:focus { + background: rgba( 255, 255, 255, 0.2 ); + } +} + // General styles for html elements // rendered inside a notice .notice { @@ -119,38 +177,6 @@ } } -.notice__button { - cursor: pointer; - margin-left: 0.428em; -} - -// "X" for dismissing a notice -.notice__dismiss { - display: flex; - padding: 11px 16px; - cursor: pointer; - color: $gray; - - @include breakpoint( ">660px" ) { - padding: 13px 16px; - } - - &:hover, - &:focus { - color: $gray-dark; - } - - .notice & { - color: $gray; - opacity: 0.85; - - &:hover, - &:focus { - opacity: 1; - } - } -} - // Compact notices .notice.is-compact { border-radius: 2px; @@ -211,29 +237,4 @@ } } -// ArrowLink sub-component -// specificity for general `a` elements within notice is too great -.notice a.notice__action { - background: rgba( 0, 0, 0, 0.2 ); - box-sizing: border-box; - color: $white; - cursor: pointer; - display: flex; - align-items: center; - font-size: 15px; - font-weight: 400; - margin-left: auto; // forces the element to the right; - padding: 13px 16px; - text-decoration: none; - white-space: nowrap; - - .gridicon { - margin-left: 8px; - opacity: 0.7; - } - &:hover, - &:focus { - background: rgba( 255, 255, 255, 0.2 ); - } -}