theme: Improve button styling
- Move the more generic %button style before %bubble_button to reduce ugly overrides. - Remove sizing factors from _drawing.scss to reduce ugly !importants. - Make the %bubble_button style more consistent. - Add missing focus styling to %notification_bubble. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/931
This commit is contained in:
parent
7ed39f7905
commit
5195f6f92e
@ -139,14 +139,30 @@ stage {
|
|||||||
&:focus { border: 2px solid $selected_bg_color;}
|
&:focus { border: 2px solid $selected_bg_color;}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// button styling
|
||||||
|
%button {
|
||||||
|
border-radius: $base_border_radius;
|
||||||
|
border-style: solid;
|
||||||
|
border-width: 1px;
|
||||||
|
min-height: 22px;
|
||||||
|
padding: $base_padding * 0.5 $base_padding * 4;
|
||||||
|
|
||||||
|
@include button(normal);
|
||||||
|
&:focus { @include button(focus);}
|
||||||
|
&:hover { @include button(hover);}
|
||||||
|
&:insensitive { @include button(insensitive);}
|
||||||
|
&:active { @include button(active);}
|
||||||
|
}
|
||||||
|
|
||||||
// buttons in dialogs
|
// buttons in dialogs
|
||||||
%bubble_button {
|
%bubble_button {
|
||||||
@include button(normal);
|
@include button(normal);
|
||||||
padding: $base_padding * 2;
|
padding: $base_padding * 2;
|
||||||
border-color: $bubble_borders_color;
|
border-color: $bubble_borders_color;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 0 !important;
|
border-width: 1px;
|
||||||
border-right-width: 1px !important;
|
border-left-width: 0;
|
||||||
|
border-bottom-width: 0;
|
||||||
box-shadow:none !important;
|
box-shadow:none !important;
|
||||||
|
|
||||||
&:insensitive { @include button(insensitive);}
|
&:insensitive { @include button(insensitive);}
|
||||||
@ -160,7 +176,7 @@ stage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border-right-width: 0 !important;
|
border-right-width: 0;
|
||||||
border-radius: 0 0 $modal_radius - 2px 0;
|
border-radius: 0 0 $modal_radius - 2px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -169,38 +185,26 @@ stage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// button styling
|
|
||||||
%button {
|
|
||||||
border-radius: $base_border_radius;
|
|
||||||
border-width: 1px;
|
|
||||||
min-height: 22px;
|
|
||||||
padding: $base_padding * 0.5 $base_padding * 4;
|
|
||||||
|
|
||||||
@include button(normal);
|
|
||||||
&:focus { @include button(focus);}
|
|
||||||
&:hover { @include button(hover);}
|
|
||||||
&:insensitive { @include button(insensitive);}
|
|
||||||
&:active { @include button(active);}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// notification styling
|
// notification styling
|
||||||
%notification_bubble {
|
%notification_bubble {
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
border-radius:$base_border_radius + 2px;
|
border-radius:$base_border_radius + 2px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: $base_margin;
|
margin: $base_margin;
|
||||||
|
|
||||||
@include button(normal);
|
@include button(normal);
|
||||||
|
|
||||||
&:focus,
|
&:focus {
|
||||||
|
@include button(focus);
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
// margin-top: $base_margin - 1px;
|
|
||||||
// margin-bottom: $base_margin + 1px;
|
|
||||||
@include button(hover);
|
@include button(hover);
|
||||||
}
|
}
|
||||||
|
|
||||||
&:active {
|
&:active {
|
||||||
@include button(active);
|
@include button(active);
|
||||||
// margin: $base_margin;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -134,8 +134,6 @@
|
|||||||
@if $t==normal {
|
@if $t==normal {
|
||||||
color: $tc;
|
color: $tc;
|
||||||
background-color: lighten($c, 3%) !important;
|
background-color: lighten($c, 3%) !important;
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: draw_border_color($c);
|
border-color: draw_border_color($c);
|
||||||
@include draw_shadows(0 1px 1px 0 $shadow_color);
|
@include draw_shadows(0 1px 1px 0 $shadow_color);
|
||||||
// box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
// box-shadow: 0 1px 1px 0 rgba(0,0,0,0.1);
|
||||||
@ -156,8 +154,6 @@
|
|||||||
@else if $t==hover {
|
@else if $t==hover {
|
||||||
color: $tc;
|
color: $tc;
|
||||||
background-color: lighten($c, if($variant == 'light', 8%, 5%)) !important;
|
background-color: lighten($c, if($variant == 'light', 8%, 5%)) !important;
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
|
border-color: if($variant == 'light', draw_border_color(lighten($c, 7%)), draw_border_color($c));
|
||||||
@include draw_shadows(0 1px 1px 0 $shadow_color);
|
@include draw_shadows(0 1px 1px 0 $shadow_color);
|
||||||
text-shadow: 0 1px $text_shadow_color;
|
text-shadow: 0 1px $text_shadow_color;
|
||||||
@ -168,8 +164,6 @@
|
|||||||
@else if $t==active {
|
@else if $t==active {
|
||||||
color: $tc;
|
color: $tc;
|
||||||
background-color: darken($c,3%) !important;
|
background-color: darken($c,3%) !important;
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: draw_border_color(if($variant == 'light', $c, darken($c,7%)));
|
border-color: draw_border_color(if($variant == 'light', $c, darken($c,7%)));
|
||||||
text-shadow: none;
|
text-shadow: none;
|
||||||
icon-shadow: none;
|
icon-shadow: none;
|
||||||
@ -179,8 +173,6 @@
|
|||||||
// insensitive button
|
// insensitive button
|
||||||
@else if $t==insensitive {
|
@else if $t==insensitive {
|
||||||
color: $insensitive_fg_color;
|
color: $insensitive_fg_color;
|
||||||
border-width: 1px;
|
|
||||||
border-style: solid;
|
|
||||||
border-color: $insensitive_borders_color;
|
border-color: $insensitive_borders_color;
|
||||||
background-color: $insensitive_bg_color !important;
|
background-color: $insensitive_bg_color !important;
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
.hotplug-notification-item {
|
.hotplug-notification-item {
|
||||||
@extend %bubble_button;
|
@extend %bubble_button;
|
||||||
border: none; box-shadow: none;
|
|
||||||
padding: 2px 10px;
|
|
||||||
&:focus { padding: 1px 71px 1px 11px; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hotplug-notification-item-icon {
|
.hotplug-notification-item-icon {
|
||||||
icon-size: 24px;
|
icon-size: 24px;
|
||||||
padding: 2px 5px;
|
padding: 0 4px;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,8 @@ $default_key_bg_color: if($variant=='light', darken($osd_bg_color, 11%), lighten
|
|||||||
@include fontsize($base_font_size + 5);
|
@include fontsize($base_font_size + 5);
|
||||||
min-height: $key_size;
|
min-height: $key_size;
|
||||||
min-width: $key_size;
|
min-width: $key_size;
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
border-radius: $key_border_radius;
|
border-radius: $key_border_radius;
|
||||||
|
|
||||||
&:grayed { //FIXMEy
|
&:grayed { //FIXMEy
|
||||||
|
@ -43,18 +43,11 @@ $notification_banner_width: 34em;
|
|||||||
|
|
||||||
.notification-actions {
|
.notification-actions {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
color: $fg_color;
|
|
||||||
border-top: 1px solid $bubble_borders_color;
|
|
||||||
spacing: 0;
|
spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-button {
|
.notification-button {
|
||||||
@extend %bubble_button;
|
@extend %bubble_button;
|
||||||
min-height: $notification_banner_height * 0.5;
|
|
||||||
padding: $base_padding !important;
|
|
||||||
border-top-width: 0 !important;
|
|
||||||
|
|
||||||
&:focus { box-shadow: none; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user