This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new f2eba58  jewel-themes: refactor button-themes to avoid sass build error
f2eba58 is described below

commit f2eba584b53288248df765335755c24f3fc57704
Author: Carlos Rovira <[email protected]>
AuthorDate: Mon Feb 24 14:45:24 2020 +0100

    jewel-themes: refactor button-themes to avoid sass build error
---
 .../themes/JewelTheme/src/main/sass/_mixins.sass   | 83 ++++++++++++++++++++++
 .../main/sass/components-emphasized/_button.sass   |  1 +
 .../sass/components-emphasized/_togglebutton.sass  |  1 +
 .../src/main/sass/components-primary/_button.sass  | 40 -----------
 .../sass/components-primary/_togglebutton.sass     | 42 -----------
 .../main/sass/components-secondary/_button.sass    |  1 +
 .../sass/components-secondary/_togglebutton.sass   |  1 +
 7 files changed, 87 insertions(+), 82 deletions(-)

diff --git a/frameworks/themes/JewelTheme/src/main/sass/_mixins.sass 
b/frameworks/themes/JewelTheme/src/main/sass/_mixins.sass
index c03de27..f70e453 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/_mixins.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/_mixins.sass
@@ -104,3 +104,86 @@
                                background: $disabled-color !important
                                border: 1px solid $disabled-border-color 
!important
                        box-shadow: none !important
+
+
+=button-theme($button-color, $text-color, $outlined: false, $unboxed: false)
+       
+       +jewel-bg-border("normal", $button-color, $outlined, $unboxed, 
$button-border-radius)
+       
+       @if $outlined or $unboxed
+               color: darken($button-color, 15%)
+       @else
+               color: $text-color
+       
+       @if not $outlined and not $unboxed and not $flat and $text-color == 
$font-theme-color
+               text-shadow: 0 -1px 0 rgba(darken($button-color, 30%), .7)
+       @else
+               text-shadow: none
+       
+       &:hover, &:hover:focus
+               +jewel-bg-border("hover", $button-color, $outlined, $unboxed)
+               @if $outlined or $unboxed
+                       color: darken($button-color, 25%)
+               @else
+                       color: $text-color
+       
+       &:active, &:active:focus
+               +jewel-bg-border("active", $button-color, $outlined, $unboxed)
+               @if $outlined or $unboxed
+                       color: darken($button-color, 25%)
+               @else
+                       color: $text-color
+       
+       &:focus
+               +jewel-bg-border("focus", $button-color, $outlined, $unboxed)
+               @if $outlined or $unboxed
+                       color: darken($button-color, 25%)
+               @else
+                       color: $text-color
+       
+       &[disabled]
+               +jewel-bg-border("disabled", $button-color, $outlined, $unboxed)
+               color: $disabled-font-color
+               text-shadow: unset
+
+=togglebutton-theme($togglebutton-color, $text-color, $outlined: false, 
$unboxed: false)
+       
+       +jewel-bg-border("normal", $togglebutton-color, $outlined, $unboxed, 
$togglebutton-border-radius)
+       
+       @if $outlined or $unboxed
+               color: darken($togglebutton-color, 15%)
+       @else
+               color: $text-color
+       
+       @if not $outlined and not $unboxed and not $flat and $text-color == 
$font-theme-color
+               text-shadow: 0 -1px 0 rgba(darken($togglebutton-color, 30%), .7)
+       @else
+               text-shadow: none
+
+       &:hover, &:hover:focus
+               +jewel-bg-border("hover", $togglebutton-color, $outlined, 
$unboxed)
+               @if $outlined or $unboxed
+                       color: darken($togglebutton-color, 25%)
+               @else
+                       color: $text-color
+       &:active, &:active:focus
+               +jewel-bg-border("active", $togglebutton-color, $outlined, 
$unboxed)
+               @if $outlined or $unboxed
+                       color: darken($togglebutton-color, 25%)
+               @else
+                       color: $text-color
+
+       &:focus
+               +jewel-bg-border("focus", $togglebutton-color, $outlined, 
$unboxed)
+               @if $outlined or $unboxed
+                       color: darken($togglebutton-color, 25%)
+               @else
+                       color: $text-color
+               
+       &[disabled]
+               +jewel-bg-border("disabled", $togglebutton-color, $outlined, 
$unboxed)
+               color: $disabled-font-color
+               text-shadow: unset
+       
+       &.selected
+               +jewel-bg-border("selected", $togglebutton-color)
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_button.sass 
b/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_button.sass
index 0cf638c..eaa15a7 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_button.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_button.sass
@@ -20,6 +20,7 @@
 // Jewel Button
 
 // Button variables
+$button-border-radius: $border-radius
 
 .jewel.button.emphasized
        +button-theme($emphasized-color, $font-theme-color, false)
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_togglebutton.sass
 
b/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_togglebutton.sass
index 27c4152..7265ffe 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_togglebutton.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-emphasized/_togglebutton.sass
@@ -20,6 +20,7 @@
 // Jewel ToggleButton
 
 // ToggleButton variables
+$togglebutton-border-radius: $border-radius
 
 .jewel.togglebutton.emphasized
        +togglebutton-theme($emphasized-color, $font-theme-color, false)
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass 
b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
index 7dc32ec..b6ec063 100644
--- a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
+++ b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_button.sass
@@ -25,46 +25,6 @@ $button-padding: 0.679em 1.12em !default
 $icon-button-padding: 0.429em 0.87em !default
 $button-border-radius: $border-radius
 
-=button-theme($button-color, $text-color, $outlined: false, $unboxed: false)
-       
-       +jewel-bg-border("normal", $button-color, $outlined, $unboxed, 
$button-border-radius)
-       
-       @if $outlined or $unboxed
-               color: darken($button-color, 15%)
-       @else
-               color: $text-color
-       
-       @if not $outlined and not $unboxed and not $flat and $text-color == 
$font-theme-color
-               text-shadow: 0 -1px 0 rgba(darken($button-color, 30%), .7)
-       @else
-               text-shadow: none
-       
-       &:hover, &:hover:focus
-               +jewel-bg-border("hover", $button-color, $outlined, $unboxed)
-               @if $outlined or $unboxed
-                       color: darken($button-color, 25%)
-               @else
-                       color: $text-color
-       
-       &:active, &:active:focus
-               +jewel-bg-border("active", $button-color, $outlined, $unboxed)
-               @if $outlined or $unboxed
-                       color: darken($button-color, 25%)
-               @else
-                       color: $text-color
-       
-       &:focus
-               +jewel-bg-border("focus", $button-color, $outlined, $unboxed)
-               @if $outlined or $unboxed
-                       color: darken($button-color, 25%)
-               @else
-                       color: $text-color
-       
-       &[disabled]
-               +jewel-bg-border("disabled", $button-color, $outlined, $unboxed)
-               color: $disabled-font-color
-               text-shadow: unset
-
 .jewel.button
        margin: $button-margin
        padding: $button-padding
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_togglebutton.sass
 
b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_togglebutton.sass
index 4524076..c7aa47e 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-primary/_togglebutton.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-primary/_togglebutton.sass
@@ -25,48 +25,6 @@ $togglebutton-padding: 0.679em 1.12em !default
 $icon-togglebutton-padding: 0.429em 0.87em !default
 $togglebutton-border-radius: $border-radius
 
-=togglebutton-theme($togglebutton-color, $text-color, $outlined: false, 
$unboxed: false)
-       
-       +jewel-bg-border("normal", $togglebutton-color, $outlined, $unboxed, 
$togglebutton-border-radius)
-       
-       @if $outlined or $unboxed
-               color: darken($togglebutton-color, 15%)
-       @else
-               color: $text-color
-       
-       @if not $outlined and not $unboxed and not $flat and $text-color == 
$font-theme-color
-               text-shadow: 0 -1px 0 rgba(darken($togglebutton-color, 30%), .7)
-       @else
-               text-shadow: none
-
-       &:hover, &:hover:focus
-               +jewel-bg-border("hover", $togglebutton-color, $outlined, 
$unboxed)
-               @if $outlined or $unboxed
-                       color: darken($togglebutton-color, 25%)
-               @else
-                       color: $text-color
-       &:active, &:active:focus
-               +jewel-bg-border("active", $togglebutton-color, $outlined, 
$unboxed)
-               @if $outlined or $unboxed
-                       color: darken($togglebutton-color, 25%)
-               @else
-                       color: $text-color
-
-       &:focus
-               +jewel-bg-border("focus", $togglebutton-color, $outlined, 
$unboxed)
-               @if $outlined or $unboxed
-                       color: darken($togglebutton-color, 25%)
-               @else
-                       color: $text-color
-               
-       &[disabled]
-               +jewel-bg-border("disabled", $togglebutton-color, $outlined, 
$unboxed)
-               color: $disabled-font-color
-               text-shadow: unset
-       
-       &.selected
-               +jewel-bg-border("selected", $togglebutton-color)
-
 .jewel.togglebutton
        margin: $togglebutton-margin
        padding: $togglebutton-padding
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_button.sass 
b/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_button.sass
index f4b4843..6f1e349 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_button.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_button.sass
@@ -20,6 +20,7 @@
 // Jewel Button
 
 // Button variables
+$button-border-radius: $border-radius
 
 .jewel.button.secondary
        +button-theme($secondary-color, $font-theme-color, false)
diff --git 
a/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_togglebutton.sass
 
b/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_togglebutton.sass
index b62113b..259b805 100644
--- 
a/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_togglebutton.sass
+++ 
b/frameworks/themes/JewelTheme/src/main/sass/components-secondary/_togglebutton.sass
@@ -20,6 +20,7 @@
 // Jewel ToggleButton
 
 // ToggleButton variables
+$togglebutton-border-radius: $border-radius
        
 .jewel.togglebutton.secondary
        +togglebutton-theme($secondary-color, $font-theme-color, false)

Reply via email to