Reference Variables from Theme.yaml inside Theme.yaml #129
HitArrowLegend
started this conversation in
Ideas
Replies: 2 comments
-
Ooooh, I like that! |
Beta Was this translation helpful? Give feedback.
0 replies
-
At the moment, this is also possible. Through the theme settings, you can use colorpicker, and output the variables to the css, including the variables of the css itself. Example: <head>
...
<style type="text/css">
* {
--primary-color: {{ this.theme.primary_color }};
}
</style>
...
<link href="{{ 'assets/css/style.css' | theme }}" />
</head> in theme.yaml name: My Theme
# [...]
form:
fields:
primary_color:
label: Primary Color
comment: The website primary color
type: colorpicker
default: #fff in style.css css example: .myDiv {
color: var(--primary-color);
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I think that it would be nice to be able to use already chosen colors in a color_palette tab, somewhere else in that theme.yaml.
XenForo added that for their 2.0. Let's say a theme has a "color_branding" and a "color_palette" tab in which a user can define all his theme colors.
It would be nice to be able to add tab (or two like for XF2.0) in the current colorpicker to be able to use the already referenced variables so that a user can keep consistency on his website (and not have two slightly different greens that were meant to be the same).
This is how XenForo does it, and it's just amazing in my opinion.
https://puu.sh/HCtPs/26c93a5ddf.png
https://puu.sh/HCtPA/f786f066b8.png
https://puu.sh/HCtPH/a904f77790.png
Beta Was this translation helpful? Give feedback.
All reactions