diff --git a/src/alerts/flash.scss b/src/alerts/flash.scss index d30c0333..ee262bfa 100644 --- a/src/alerts/flash.scss +++ b/src/alerts/flash.scss @@ -1,8 +1,9 @@ // Default flash // stylelint-disable selector-max-type .flash { - min-height: $size-7; position: relative; + min-height: $size-7; + // stylelint-disable-next-line primer/spacing padding: 12px $spacer-3; // stylelint-disable-next-line primer/colors color: $blue-800; diff --git a/src/avatars/avatar.scss b/src/avatars/avatar.scss index fa742e04..0d95124b 100644 --- a/src/avatars/avatar.scss +++ b/src/avatars/avatar.scss @@ -1,15 +1,10 @@ .avatar { display: inline-block; + max-width: 100%; overflow: hidden; // Ensure page layout in Firefox should images fail to load line-height: $lh-condensed-ultra; vertical-align: middle; border-radius: $border-radius; - max-width: 100%; -} - -.avatar-small { - // stylelint-disable-next-line primer/borders - border-radius: $border-radius / 2; } .avatar-link { @@ -24,13 +19,27 @@ margin-bottom: 3px; } -// sizes +// Border radius -.avatar-1 { width: $size-1; height: $size-1; border-radius: $border-radius / 2; } -.avatar-2 { width: $size-2; height: $size-2; border-radius: $border-radius / 2; } -.avatar-3 { width: $size-3; height: $size-3; } -.avatar-4 { width: $size-4; height: $size-4; } -.avatar-5 { width: $size-5; height: $size-5; } -.avatar-6 { width: $size-6; height: $size-6; } -.avatar-7 { width: $size-7; height: $size-7; } -.avatar-8 { width: $size-8; height: $size-8; } +.avatar-1, +.avatar-2, +.avatar-small { + // stylelint-disable-next-line primer/borders + border-radius: $border-radius / 2; +} + +// Sizes + +@mixin avatar-size( $size ) { + width: $size; + height: $size; +} + +.avatar-1 { @include avatar-size( $size-1 ); } +.avatar-2 { @include avatar-size( $size-2 ); } +.avatar-3 { @include avatar-size( $size-3 ); } +.avatar-4 { @include avatar-size( $size-4 ); } +.avatar-5 { @include avatar-size( $size-5 ); } +.avatar-6 { @include avatar-size( $size-6 ); } +.avatar-7 { @include avatar-size( $size-7 ); } +.avatar-8 { @include avatar-size( $size-8 ); } diff --git a/src/buttons/button.scss b/src/buttons/button.scss index f50329cf..8d3b754e 100644 --- a/src/buttons/button.scss +++ b/src/buttons/button.scss @@ -4,11 +4,11 @@ .btn { position: relative; display: inline-block; - // stylelint-disable-next-line primer/spacing padding: 0 $spacer-3; font-size: $body-font-size; font-weight: $font-weight-semibold; - line-height: heightWithoutBorder($size-5); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-5); white-space: nowrap; vertical-align: middle; cursor: pointer; @@ -268,12 +268,13 @@ // // Tweak `line-height` to make them smaller. .btn-sm { - // stylelint-disable-next-line primer/spacing - padding-left: 12px; // stylelint-disable-next-line primer/spacing padding-right: 12px; + // stylelint-disable-next-line primer/spacing + padding-left: 12px; font-size: $font-size-small; - line-height: heightWithoutBorder($size-4); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-4); } // Large button adds more padding around text. Use font-size utils to increase font-size.. e.g,

diff --git a/src/forms/form-control.scss b/src/forms/form-control.scss index be123b93..987738c7 100644 --- a/src/forms/form-control.scss +++ b/src/forms/form-control.scss @@ -20,7 +20,8 @@ label { // stylelint-disable-next-line primer/spacing padding: 0 12px; font-size: $body-font-size; - line-height: heightWithoutBorder($size-5); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-5); color: $text-gray-dark; vertical-align: middle; background-color: $bg-white; @@ -94,13 +95,14 @@ textarea.form-control { // Mini inputs, to match .minibutton .input-sm { font-size: $font-size-small; - line-height: heightWithoutBorder($size-4); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-4); } // Large inputs .input-lg { - padding-left: $spacer-3; padding-right: $spacer-3; + padding-left: $spacer-3; font-size: $h4-size; } diff --git a/src/forms/form-select.scss b/src/forms/form-select.scss index 60bb31a5..238a37bb 100644 --- a/src/forms/form-select.scss +++ b/src/forms/form-select.scss @@ -4,6 +4,7 @@ .form-select { display: inline-block; max-width: 100%; + // stylelint-disable-next-line primer/typography height: $size-5; padding-right: $spacer-4; background-color: $bg-white; @@ -27,7 +28,8 @@ height: $size-4; min-height: $size-4; font-size: $font-size-small; - line-height: heightWithoutBorder($size-4); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-4); &[multiple] { height: auto; diff --git a/src/labels/labels.scss b/src/labels/labels.scss index 308398e6..55040214 100644 --- a/src/labels/labels.scss +++ b/src/labels/labels.scss @@ -10,8 +10,8 @@ .label, // TODO: Deprecte .Label { @include labels-base; - border-color: $border-color; background-color: transparent !important; // TODO: Remove again + border-color: $border-color; &:hover { text-decoration: none; diff --git a/src/labels/mixins.scss b/src/labels/mixins.scss index 0d68707f..2e351848 100644 --- a/src/labels/mixins.scss +++ b/src/labels/mixins.scss @@ -10,14 +10,13 @@ font-size: $font-size-small; font-weight: $font-weight-semibold; line-height: 18px; - // stylelint-disable-next-line primer/borders border: $border-width $border-style transparent; border-radius: 2em; } @mixin labels-large { - padding-left: 10px; padding-right: 10px; + padding-left: 10px; line-height: 22px; } @@ -28,6 +27,6 @@ @mixin labels--inline { display: inline; + padding: 0.1667em 0.5em; font-size: 0.9em; - padding: .1667em .5em; } diff --git a/src/labels/states.scss b/src/labels/states.scss index 50e386fe..3b2a9ed4 100644 --- a/src/labels/states.scss +++ b/src/labels/states.scss @@ -12,9 +12,11 @@ .state, // TODO: Deprecate .State { display: inline-block; + // stylelint-disable-next-line primer/spacing padding: 0 12px; font-size: $body-font-size; font-weight: $font-weight-semibold; + // stylelint-disable-next-line primer/typography line-height: $size-5; color: $text-white; text-align: center; @@ -41,9 +43,10 @@ // Small .State--small { - padding-left: $spacer-2; padding-right: $spacer-2; + padding-left: $spacer-2; font-size: $font-size-small; + // stylelint-disable-next-line primer/typography line-height: $size-3; .octicon { diff --git a/src/navigation/subnav.scss b/src/navigation/subnav.scss index 3b9e2b66..eb53e547 100644 --- a/src/navigation/subnav.scss +++ b/src/navigation/subnav.scss @@ -20,10 +20,10 @@ .subnav-item { position: relative; float: left; - // stylelint-disable-next-line primer/spacing padding: 0 $spacer-3; font-weight: $font-weight-semibold; - line-height: heightWithoutBorder($size-5); + // stylelint-disable-next-line primer/typography + line-height: height-without-border($size-5); color: $text-gray-dark; border: $border; diff --git a/src/support/mixins/typography.scss b/src/support/mixins/typography.scss index 5c0302d0..8687aed5 100644 --- a/src/support/mixins/typography.scss +++ b/src/support/mixins/typography.scss @@ -1,7 +1,7 @@ -// heightWithoutBorder +// height-without-border // // Removes top/bottom border from the total height -@function heightWithoutBorder($height) { +@function height-without-border($height) { @return $height - ($border-width * 2); }