Skip to content

Commit

Permalink
Move inline CSS Variables to end of file
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Aug 2, 2021
1 parent 660204f commit 9be76fa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ Builder.prototype.build = function(options) {
}));
const varsOverride = oVariableCollector.getAllVariables();
const cssVariablesSource = oCSSVariablesCollector.toLessVariables(varsOverride);
// eslint-disable-next-line no-unused-vars
const cssVariablesOnly = oCSSVariablesCollector.getCssVariablesDeclaration();

let cssSkeletonRtl;
Expand Down Expand Up @@ -407,9 +406,9 @@ Builder.prototype.build = function(options) {
--sapThemeMetaData-UI5-${libraryNameDashed}: ${metadataJson};
}
`;
result.css = additionalVariables + result.cssVariables + "\n" + result.css;
result.css += additionalVariables + result.cssVariables;
if (options.rtl) {
result.cssRtl = additionalVariables + result.cssVariables + "\n" + result.cssRtl;
result.cssRtl += additionalVariables + result.cssVariables;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.myOtherUiLibRule1 {
color: #fefefe;
}
.myOtherUiLibRule2 {
padding: 1px 4px 3px 2px;
}

:root {
--sapUiTheme-my-other-ui-lib: true;
Expand All @@ -7,10 +13,3 @@
--_my_other_ui_lib_MyControl_color1: var(--color1);
--_my_other_ui_lib_MyOtherControl_color1: var(--color1);
}

.myOtherUiLibRule1 {
color: #fefefe;
}
.myOtherUiLibRule2 {
padding: 1px 4px 3px 2px;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.myOtherUiLibRule1 {
color: #fefefe;
}
.myOtherUiLibRule2 {
padding: 1px 2px 3px 4px;
}

:root {
--sapUiTheme-my-other-ui-lib: true;
Expand All @@ -7,10 +13,3 @@
--_my_other_ui_lib_MyControl_color1: var(--color1);
--_my_other_ui_lib_MyOtherControl_color1: var(--color1);
}

.myOtherUiLibRule1 {
color: #fefefe;
}
.myOtherUiLibRule2 {
padding: 1px 2px 3px 4px;
}

0 comments on commit 9be76fa

Please sign in to comment.