GtkColorButton.button {
padding: 5px; // Uniform padding on the GtkColorButton
- GtkColorSwatch:first-child:last-child { // :first-child:last-child for a specificity bump, it gets overridden by the
+ GtkColorSwatch:first-child:last-child { // :first-child:last-child for a specificity bump, it gets overridden by the
// colorpicker style, otherwise
border-radius: 0;
box-shadow: inset 0 1px 1px transparentize(black, 0.9),
$_colorswatch_shadow: inset 0 1px transparentize(black, 0.9), _widget_edge();
+ $_colorswatch_radius: 5px;
+
box-shadow: $_colorswatch_shadow;
// take care of colorswatches on selected elements
// we need to re-set the shadow here since it get axed by the previous bit
&:selected { box-shadow: $_colorswatch_shadow; }
- // border rounding
+ // base color corners rounding
+ // to avoid the artifacts caused by rounded corner anti-aliasing the base color
+ // sports a bigger radius.
+ // nth-child is needed by the custom color strip.
+ // The :not() madness is needed since actually the overlay is selectable by GtkColorSwatch > .overlay
+ // and GtkColorSwatch.overlay, I know it's weird, but this is gtk+, not a browser.
&.top {
- border-top-left-radius: 5px;
- border-top-right-radius: 5px;
+ border-top-left-radius: $_colorswatch-radius + 1px;
+ border-top-right-radius: $_colorswatch-radius + 1px;
}
&.bottom {
- border-bottom-left-radius: 5px;
- border-bottom-right-radius: 5px;
+ border-bottom-left-radius: $_colorswatch-radius + 1px;
+ border-bottom-right-radius: $_colorswatch-radius + 1px;
}
- &.left, &:first-child:not(.overlay), &:first-child:not(.top) > .overlay {
- border-top-left-radius: 5px;
- border-bottom-left-radius: 5px;
+ &.left, &:first-child:not(.overlay):not(.top) {
+ border-top-left-radius: $_colorswatch-radius + 1px;
+ border-bottom-left-radius: $_colorswatch-radius + 1px;
}
- &.right, &:last-child:not(.overlay), &:last-child:not(.bottom) > .overlay {
- border-top-right-radius: 5px;
- border-bottom-right-radius: 5px;
+ &.right, &:last-child:not(.overlay):not(.bottom) {
+ border-top-right-radius: $_colorswatch-radius + 1px;
+ border-bottom-right-radius: $_colorswatch-radius + 1px;
}
- &:only-child:not(.overlay), &:only-child > .overlay { border-radius: 5px; }
- // nth-child is used for the custom colors row.
- // the :not() madness is needed since actually the overlay is selectable by GtkColorSwatch > .overlay
- // and GtkColorSwatch.overlay, I know it's weird, but this is gtk+.
+ &:only-child:not(.overlay) { border-radius: $_colorswatch-radius + 1px; }
+
+ // overlay corner rounding
+ &.top > .overlay {
+ border-top-left-radius: $_colorswatch-radius;
+ border-top-right-radius: $_colorswatch-radius;
+ }
+ &.bottom > .overlay {
+ border-bottom-left-radius: $_colorswatch-radius;
+ border-bottom-right-radius: $_colorswatch-radius;
+ }
+ &:first-child:not(.top) > .overlay {
+ border-top-left-radius: $_colorswatch-radius;
+ border-bottom-left-radius: $_colorswatch-radius;
+ }
+ &:last-child:not(.bottom) > .overlay {
+ border-top-right-radius: $_colorswatch-radius;
+ border-bottom-right-radius: $_colorswatch-radius;
+ }
+ &:only-child > .overlay { border-radius: $_colorswatch-radius; }
// hover effect
&:hover,
transparentize(white, 1) 50%);
box-shadow: inset 0 1px transparentize(white, 0.6),
inset 0 -1px if($variant == 'light', transparentize(black, 0.9), transparentize(black, 0.6));
+ &.color-dark { // swatches with colors with luminosity lower than 50% get the color-dark class
+ background-image: linear-gradient(135deg, transparentize(white, 0.5),
+ transparentize(white, 1) 50%);
+ }
}
&:backdrop,
- &:backdrop:selected {
+ &:backdrop:selected
+ &.color-dark:backdrop,
+ &.color-dark:backdrop:selected {
background-image: none;
box-shadow: none;
}
&:backdrop { box-shadow: none; }
}
- // indicator and keynav outline colors, color-dark is a color with luminosity lower then 50%
+ // indicator and keynav outline colors
&.color-dark {
color: white;
outline-color: transparentize(black, 0.7);
}
// Overflow indication, works similarly to the overshoot, the size if fixed tho.
-.undershoot {
+.undershoot {
&.top {
@include undershoot(top);
}
GtkColorSwatch:selected {
box-shadow: inset 0 1px rgba(0, 0, 0, 0.1), 0 1px rgba(238, 238, 236, 0.1); }
GtkColorSwatch.top {
+ border-top-left-radius: 6px;
+ border-top-right-radius: 6px; }
+ GtkColorSwatch.bottom {
+ border-bottom-left-radius: 6px;
+ border-bottom-right-radius: 6px; }
+ GtkColorSwatch.left, GtkColorSwatch:first-child:not(.overlay):not(.top) {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px; }
+ GtkColorSwatch.right, GtkColorSwatch:last-child:not(.overlay):not(.bottom) {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px; }
+ GtkColorSwatch:only-child:not(.overlay) {
+ border-radius: 6px; }
+ GtkColorSwatch.top > .overlay {
border-top-left-radius: 5px;
border-top-right-radius: 5px; }
- GtkColorSwatch.bottom {
+ GtkColorSwatch.bottom > .overlay {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px; }
- GtkColorSwatch.left, GtkColorSwatch:first-child:not(.overlay), GtkColorSwatch:first-child:not(.top) > .overlay {
+ GtkColorSwatch:first-child:not(.top) > .overlay {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px; }
- GtkColorSwatch.right, GtkColorSwatch:last-child:not(.overlay), GtkColorSwatch:last-child:not(.bottom) > .overlay {
+ GtkColorSwatch:last-child:not(.bottom) > .overlay {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px; }
- GtkColorSwatch:only-child:not(.overlay), GtkColorSwatch:only-child > .overlay {
+ GtkColorSwatch:only-child > .overlay {
border-radius: 5px; }
GtkColorSwatch:hover, GtkColorSwatch:hover:selected {
background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 50%);
box-shadow: inset 0 1px rgba(255, 255, 255, 0.4), inset 0 -1px rgba(0, 0, 0, 0.4); }
- GtkColorSwatch:backdrop, GtkColorSwatch:backdrop:selected {
+ GtkColorSwatch:hover.color-dark, GtkColorSwatch:hover:selected.color-dark {
+ background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 50%); }
+ GtkColorSwatch:backdrop, GtkColorSwatch:backdrop:selected
+ GtkColorSwatch.color-dark:backdrop, GtkColorSwatch.color-dark:backdrop:selected {
background-image: none;
box-shadow: none; }
GtkColorEditor GtkColorSwatch {
GtkColorSwatch:selected {
box-shadow: inset 0 1px rgba(0, 0, 0, 0.1), 0 1px white; }
GtkColorSwatch.top {
+ border-top-left-radius: 6px;
+ border-top-right-radius: 6px; }
+ GtkColorSwatch.bottom {
+ border-bottom-left-radius: 6px;
+ border-bottom-right-radius: 6px; }
+ GtkColorSwatch.left, GtkColorSwatch:first-child:not(.overlay):not(.top) {
+ border-top-left-radius: 6px;
+ border-bottom-left-radius: 6px; }
+ GtkColorSwatch.right, GtkColorSwatch:last-child:not(.overlay):not(.bottom) {
+ border-top-right-radius: 6px;
+ border-bottom-right-radius: 6px; }
+ GtkColorSwatch:only-child:not(.overlay) {
+ border-radius: 6px; }
+ GtkColorSwatch.top > .overlay {
border-top-left-radius: 5px;
border-top-right-radius: 5px; }
- GtkColorSwatch.bottom {
+ GtkColorSwatch.bottom > .overlay {
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px; }
- GtkColorSwatch.left, GtkColorSwatch:first-child:not(.overlay), GtkColorSwatch:first-child:not(.top) > .overlay {
+ GtkColorSwatch:first-child:not(.top) > .overlay {
border-top-left-radius: 5px;
border-bottom-left-radius: 5px; }
- GtkColorSwatch.right, GtkColorSwatch:last-child:not(.overlay), GtkColorSwatch:last-child:not(.bottom) > .overlay {
+ GtkColorSwatch:last-child:not(.bottom) > .overlay {
border-top-right-radius: 5px;
border-bottom-right-radius: 5px; }
- GtkColorSwatch:only-child:not(.overlay), GtkColorSwatch:only-child > .overlay {
+ GtkColorSwatch:only-child > .overlay {
border-radius: 5px; }
GtkColorSwatch:hover, GtkColorSwatch:hover:selected {
background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0) 50%);
box-shadow: inset 0 1px rgba(255, 255, 255, 0.4), inset 0 -1px rgba(0, 0, 0, 0.1); }
- GtkColorSwatch:backdrop, GtkColorSwatch:backdrop:selected {
+ GtkColorSwatch:hover.color-dark, GtkColorSwatch:hover:selected.color-dark {
+ background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 50%); }
+ GtkColorSwatch:backdrop, GtkColorSwatch:backdrop:selected
+ GtkColorSwatch.color-dark:backdrop, GtkColorSwatch.color-dark:backdrop:selected {
background-image: none;
box-shadow: none; }
GtkColorEditor GtkColorSwatch {