mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-17 07:50:04 +00:00
LibWebView: Use custom properties for syntax-highlighting colors
This commit is contained in:
parent
1db243c006
commit
66c39f3da4
Notes:
github-actions[bot]
2024-09-30 07:54:41 +00:00
Author: https://github.com/AtkinsSJ
Commit: 66c39f3da4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1513
1 changed files with 37 additions and 39 deletions
|
@ -71,6 +71,32 @@ private:
|
||||||
String highlight_source(URL::URL const&, StringView);
|
String highlight_source(URL::URL const&, StringView);
|
||||||
|
|
||||||
constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
|
constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
|
||||||
|
html {
|
||||||
|
background-color: rgb(30, 30, 30);
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--comment-color: lightgreen;
|
||||||
|
--keyword-color: orangered;
|
||||||
|
--name-color: orange;
|
||||||
|
--value-color: deepskyblue;
|
||||||
|
--internal-color: darkgrey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
:root {
|
||||||
|
--comment-color: green;
|
||||||
|
--keyword-color: red;
|
||||||
|
--name-color: darkorange;
|
||||||
|
--value-color: blue;
|
||||||
|
--internal-color: dimgrey;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.html {
|
.html {
|
||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
|
||||||
|
@ -78,47 +104,19 @@ constexpr inline StringView HTML_HIGHLIGHTER_STYLE = R"~~~(
|
||||||
|
|
||||||
.tag {
|
.tag {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
|
color: var(--keyword-color);
|
||||||
}
|
}
|
||||||
|
.comment {
|
||||||
@media (prefers-color-scheme: dark) {
|
color: var(--comment-color);
|
||||||
/* FIXME: We should be able to remove the HTML style when "color-scheme" is supported */
|
|
||||||
html {
|
|
||||||
background-color: rgb(30, 30, 30);
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
.comment {
|
|
||||||
color: lightgreen;
|
|
||||||
}
|
|
||||||
.tag {
|
|
||||||
color: orangered;
|
|
||||||
}
|
|
||||||
.attribute-name {
|
|
||||||
color: orange;
|
|
||||||
}
|
|
||||||
.attribute-value {
|
|
||||||
color: deepskyblue;
|
|
||||||
}
|
|
||||||
.internal {
|
|
||||||
color: darkgrey;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
.attribute-name {
|
||||||
@media (prefers-color-scheme: light) {
|
color: var(--name-color);
|
||||||
.comment {
|
}
|
||||||
color: green;
|
.attribute-value {
|
||||||
}
|
color: var(--value-color);
|
||||||
.tag {
|
}
|
||||||
color: red;
|
.internal {
|
||||||
}
|
color: var(--internal-color);
|
||||||
.attribute-name {
|
|
||||||
color: darkorange;
|
|
||||||
}
|
|
||||||
.attribute-value {
|
|
||||||
color: blue;
|
|
||||||
}
|
|
||||||
.internal {
|
|
||||||
color: dimgray;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
)~~~"sv;
|
)~~~"sv;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue