Skip to content

Commit

Permalink
Add inner border radius config (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
mimoguz authored Oct 27, 2022
1 parent 6342b3f commit 5d2e39b
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions styles/src/components/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $opacity-hover: 0.9 !default;

-fx-background-color: -color-button-border, -color-button-bg;
-fx-background-insets: 0, cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-graphic-text-gap: cfg.$graphic-gap;
-fx-text-fill: -color-button-fg;
-fx-alignment: CENTER;
Expand Down Expand Up @@ -168,7 +168,7 @@ $opacity-hover: 0.9 !default;

// toggle button
&.left-pill {
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius, cfg.$inner-border-radius 0 0 cfg.$inner-border-radius;
-fx-background-insets: 0, cfg.$border-width 0 cfg.$border-width cfg.$border-width;

&:hover,
Expand All @@ -188,7 +188,7 @@ $opacity-hover: 0.9 !default;
}

&.right-pill {
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0;
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0, 0 cfg.$inner-border-radius cfg.$inner-border-radius 0;
-fx-background-insets: 0, cfg.$border-width cfg.$border-width cfg.$border-width 0;

&:hover,
Expand Down
2 changes: 1 addition & 1 deletion styles/src/components/_checkbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
>.box {
-fx-background-color: -color-fg-default, -color-bg-default;
-fx-background-insets: 0, cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-padding: cfg.$checkbox-mark-padding-y cfg.$checkbox-mark-padding-x cfg.$checkbox-mark-padding-y cfg.$checkbox-mark-padding-x;
-fx-alignment: CENTER;

Expand Down
4 changes: 2 additions & 2 deletions styles/src/components/_color-picker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.color-palette {
-fx-background-color: -color-border-default, -color-bg-default;
-fx-background-insets: 0, cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-spacing: 10px;
-fx-padding: 1em;

Expand Down Expand Up @@ -162,7 +162,7 @@
-fx-background-color: -color-border-default, -color-bg-default;
-fx-background-insets: calc(14px - cfg.$border-width) 0 calc(6px - cfg.$border-width) 0,
14px cfg.$border-width 6px cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
}

>.settings-label {
Expand Down
10 changes: 5 additions & 5 deletions styles/src/components/_combo-box.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $color-list-bg-selected: if(cfg.$darkMode, -color-base-6, -color-base-2) !defaul
@mixin _combo-box-base() {
-fx-background-color: -color-border-default, -color-bg-default;
-fx-background-insets: 0, 1;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-text-fill: -color-fg-default;
-fx-alignment: CENTER;
-fx-content-display: LEFT;
Expand All @@ -45,7 +45,7 @@ $color-list-bg-selected: if(cfg.$darkMode, -color-base-6, -color-base-2) !defaul

// input group
&.left-pill {
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius, cfg.$inner-border-radius 0 0 cfg.$inner-border-radius;
-fx-background-insets: 0, cfg.$border-width 0 cfg.$border-width cfg.$border-width;

&:focused {
Expand All @@ -63,7 +63,7 @@ $color-list-bg-selected: if(cfg.$darkMode, -color-base-6, -color-base-2) !defaul
}

&.right-pill {
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0;
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0, 0 cfg.$inner-border-radius cfg.$inner-border-radius 0;
-fx-background-insets: 0, cfg.$border-width cfg.$border-width cfg.$border-width 0;

&:focused {
Expand Down Expand Up @@ -92,7 +92,7 @@ $color-list-bg-selected: if(cfg.$darkMode, -color-base-6, -color-base-2) !defaul

>.text-field {
-fx-background-insets: 0, 1 0 1 1;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius, cfg.$inner-border-radius 0 0 cfg.$inner-border-radius;
}

&:success {
Expand Down Expand Up @@ -138,7 +138,7 @@ $color-list-bg-selected: if(cfg.$darkMode, -color-base-6, -color-base-2) !defaul
>.list-view {
-fx-background-color: -color-border-default, $color-list-bg;
-fx-background-insets: 0, 1;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;

>.virtual-flow {
>.clipped-container {
Expand Down
4 changes: 2 additions & 2 deletions styles/src/components/_label.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
}

&.left-pill {
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius, cfg.$inner-border-radius 0 0 cfg.$inner-border-radius;
}

&.center-pill {
-fx-background-radius: 0;
}

&.right-pill {
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0;
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0, 0 cfg.$inner-border-radius cfg.$inner-border-radius 0;
}
}
4 changes: 2 additions & 2 deletions styles/src/components/_menu-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ $separator-width: 0.75px !default;
>.arrow-button {
-fx-background-color: -color-neutral-emphasis-plus;
-fx-background-insets: cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$inner-border-radius;
-fx-border-color: transparent;
-fx-opacity: 0.75;

Expand Down Expand Up @@ -184,7 +184,7 @@ $separator-width: 0.75px !default;

>.arrow-button {
-fx-padding: cfg.$padding-y cfg.$padding-x cfg.$padding-y cfg.$padding-x;
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0;
-fx-background-radius: 0 cfg.$inner-border-radius cfg.$inner-border-radius 0;
-fx-border-color: -color-button-fg;
-fx-border-width: 0 0 0 $separator-width;
-fx-border-insets: calc(cfg.$border-width + 6px) 0 calc(cfg.$border-width + 6px) 0;
Expand Down
2 changes: 1 addition & 1 deletion styles/src/components/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ $separator-padding: map-get(cfg.$separators, "small") !default;
-fx-background-color: -color-border-muted, $color-menuitem-bg;
-fx-background-insets: 0, 1;
-fx-padding: cfg.$popup-padding-y cfg.$popup-padding-x cfg.$popup-padding-y cfg.$popup-padding-x;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
@include effects.shadow(-color-shadow-default, cfg.$popup-shadow-radius, cfg.$popup-shadow-spread);

// no idea what's that thing and how to trigger its appearance
Expand Down
6 changes: 3 additions & 3 deletions styles/src/components/_text-input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $color-fg-password: -color-fg-muted !default;

-fx-background-color: -color-input-border, -color-input-bg;
-fx-background-insets: 0, cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-text-fill: -color-input-fg;

-fx-highlight-fill: -color-input-bg-highlight;
Expand Down Expand Up @@ -78,7 +78,7 @@ $color-fg-password: -color-fg-muted !default;

// input group
&.left-pill {
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius;
-fx-background-radius: cfg.$border-radius 0 0 cfg.$border-radius, cfg.$inner-border-radius 0 0 cfg.$inner-border-radius;
-fx-background-insets: 0, cfg.$border-width 0 cfg.$border-width cfg.$border-width;

&:focused {
Expand All @@ -96,7 +96,7 @@ $color-fg-password: -color-fg-muted !default;
}

&.right-pill {
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0;
-fx-background-radius: 0 cfg.$border-radius cfg.$border-radius 0, 0 cfg.$inner-border-radius cfg.$inner-border-radius 0;
-fx-background-insets: 0, cfg.$border-width cfg.$border-width cfg.$border-width 0;

&:focused {
Expand Down
4 changes: 2 additions & 2 deletions styles/src/components/_titled-pane.scss
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ $margin-content-dense: 10px !default;
// and '.content' and then remove one of those adjacent borders.
&:expanded {
>.title {
-fx-background-radius: cfg.$border-radius cfg.$border-radius 0 0;
-fx-background-radius: cfg.$border-radius cfg.$border-radius 0 0, cfg.$inner-border-radius cfg.$inner-border-radius 0 0;
-fx-background-insets: 0, cfg.$border-width cfg.$border-width 0 cfg.$border-width;
}
}

&:collapsed {
>.title {
-fx-background-insets: 0, cfg.$border-width;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
}
}

Expand Down
2 changes: 1 addition & 1 deletion styles/src/components/_tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ $padding-y: cfg.$padding-y !default;
-fx-background-color: $color-border, $color-bg;
-fx-background-insets: 0, cfg.$border-width;
-fx-text-fill: $color-fg;
-fx-background-radius: cfg.$border-radius;
-fx-background-radius: cfg.$border-radius, cfg.$inner-border-radius;
-fx-padding: $padding-y $padding-x $padding-y $padding-x;
-fx-opacity: $opacity;
@include effects.shadow(-color-shadow-default, cfg.$popup-shadow-radius, cfg.$popup-shadow-spread);
Expand Down
6 changes: 4 additions & 2 deletions styles/src/settings/_config.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: MIT

@use "sass:math";

$darkMode: false !default;

$font-default: 14px !default; // ~= 11pt
Expand All @@ -21,10 +23,10 @@ $padding-y-large: calc($padding-y * 1.4) !default;
$graphic-gap: 6px !default;

// Most components use background insets to draw its borders due to
// performance reasons. On border radius > 2px corners may look rather ugly.
// They're thicker than border width and sometimes a bit blurry.
// performance reasons.
$border-width: 1px !default;
$border-radius: 4px !default;
$inner-border-radius: math.max($border-radius - $border-width, 0) !default;

$opacity-disabled: 0.4 !default;

Expand Down

0 comments on commit 5d2e39b

Please sign in to comment.