-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] CSS Variables: Fix variable handling / relative urls (#172)
- Improve detection of library variables - Resolve url values in variables - Handle variables in the proper order - Enhance overall CSS Variables tests Co-authored-by: Matthias Osswald <mat.osswald@sap.com>
- Loading branch information
1 parent
a6fea7c
commit 6ace17f
Showing
22 changed files
with
334 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@link-color: #428bca; | ||
@link-color-hover: darken(@link-color, 10%); | ||
@other-var: 0 0 0.25rem 0 rgba(0, 0, 0, 0.15), inset 0 -0.0625rem 0 0 @link-color; | ||
@link-color-active: @link-color; | ||
@backgroundVariant: 1; | ||
@backgroundImage: url(img.png); | ||
@a: 100%; | ||
@var: @a; | ||
@b: darken(@link-color-active, 20%); | ||
@padLeft: 20px; | ||
@top: 5rem; | ||
@lineHeight: 2rem; | ||
@c: calc(100% - 80px); | ||
@d: -@a; | ||
@function_lighten14: lighten(@b, 10%); | ||
|
||
:root { | ||
--link-color: @link-color; | ||
--link-color-hover: @link-color-hover; | ||
--other-var: @other-var; | ||
--link-color-active: @link-color-active; | ||
--backgroundVariant: @backgroundVariant; | ||
--backgroundImage: @backgroundImage; | ||
--a: @a; | ||
--var: @var; | ||
--b: @b; | ||
--padLeft: @padLeft; | ||
--top: @top; | ||
--lineHeight: @lineHeight; | ||
--c: @c; | ||
--d: @d; | ||
--function_lighten14: @function_lighten14; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/expected/libraries/lib1/my/ui/lib/themes/foo/css_variables.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
:root { | ||
--color1: #ffffff; | ||
--url1: url('../base/111'); | ||
} | ||
.fooContrast { | ||
--color1: #000000; | ||
} | ||
|
||
/* Inline theming parameters */ | ||
#sap-ui-theme-my\.ui\.lib{background-image:url('data:text/plain;utf-8,%7B%22default%22%3A%7B%22color1%22%3A%22%23ffffff%22%2C%22url1%22%3A%22url(%27..%2Fbase%2F111%27)%22%7D%2C%22scopes%22%3A%7B%22fooContrast%22%3A%7B%22color1%22%3A%22%23000000%22%7D%7D%7D')} |
7 changes: 7 additions & 0 deletions
7
test/expected/libraries/lib1/my/ui/lib/themes/foo/css_variables.source.less
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@color1: #ffffff; | ||
@url1: url('../base/111'); | ||
|
||
:root { | ||
--color1: @color1; | ||
--url1: @url1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/expected/libraries/lib1/my/ui/lib/themes/foo/library_skeleton-RTL.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.myUiLibRule1 { | ||
color: var(--color1); | ||
} | ||
.myUiLibRule2 { | ||
padding: 1px 4px 3px 2px; | ||
} | ||
.fooContrast.myUiLibRule1, | ||
.fooContrast .myUiLibRule1 { | ||
color: var(--color1); | ||
} |
10 changes: 10 additions & 0 deletions
10
test/expected/libraries/lib1/my/ui/lib/themes/foo/library_skeleton.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.myUiLibRule1 { | ||
color: var(--color1); | ||
} | ||
.myUiLibRule2 { | ||
padding: 1px 2px 3px 4px; | ||
} | ||
.fooContrast.myUiLibRule1, | ||
.fooContrast .myUiLibRule1 { | ||
color: var(--color1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@myColor: #ff0000; | ||
|
||
:root { | ||
--myColor: @myColor; | ||
} |
Oops, something went wrong.