Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LPS-115485 Format CSS #51

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.liferay.osgi.service.tracker.collections.list.ServiceTrackerList;
import com.liferay.osgi.service.tracker.collections.list.ServiceTrackerListFactory;
import com.liferay.osgi.service.tracker.collections.map.PropertyServiceReferenceComparator;
import com.liferay.petra.string.StringPool;
import com.liferay.portal.kernel.servlet.taglib.BaseDynamicInclude;
import com.liferay.portal.kernel.servlet.taglib.DynamicInclude;

Expand Down Expand Up @@ -105,21 +106,22 @@ private void _writeCSSVariables(
for (ScopedCSSVariables scopedCSSVariables :
scopedCSSVariablesCollection) {

printWriter.print(StringPool.TAB);
printWriter.print(scopedCSSVariables.getScope());
printWriter.print(" {\n");

Map<String, String> cssVariables =
scopedCSSVariables.getCSSVariables();

for (Map.Entry<String, String> entry : cssVariables.entrySet()) {
printWriter.print("--");
printWriter.print("\t\t--");
izaera marked this conversation as resolved.
Show resolved Hide resolved
printWriter.print(entry.getKey());
printWriter.print(": ");
printWriter.print(entry.getValue());
printWriter.print(";\n");
}

printWriter.print("}\n");
printWriter.print("\t}\n");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public String getScope() {
public Map<String, String> getCSSVariables() {
return HashMapBuilder.put(
"color", "green"
).put(
"fixed-font", "\"Lucida Console\""
).put(
"font", "Comic Sans"
).build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<style data-senna-track="temporary" type="text/css">
:root {
--color: red;
}
:root {
--color: red;
}
</style>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<style data-senna-track="temporary" type="text/css">
:root {
--color: red;
}
body {
--color: green;
--font: Comic Sans;
}
:root {
--color: yellow;
--font: Arial;
}
:root {
--color: red;
}
body {
--color: green;
--fixed-font: "Lucida Console";
--font: Comic Sans;
izaera marked this conversation as resolved.
Show resolved Hide resolved
}
:root {
--color: yellow;
--font: Arial;
}
</style>