Commit 44bad37e authored by Laura Kalbag's avatar Laura Kalbag
Browse files

Start pulling in the data colour theme files as variables

Towards #164
parent cab22f8d
{{- /* COLOURS, concatenated as 1/14 file in the stylesheet */ -}}
{{- /* load in colour palette that’s applicable to "all" */ -}}
{{- $coloursAll := .Site.Data.coloursAll.json }}
{{- $coloursAll := .Site.Data.colourThemes.coloursAll.json }}
{{- /* default colours and use variables, accessible to all colour themes */ -}}
:root {
{{- /* range through all the key value pairs in the json file */ -}}
{{ range $variable, $value := .Site.Data.coloursAll }}
{{- /* range through all the key value pairs in the colour palette json file */ -}}
{{ range $variable, $value := .Site.Data.colourThemes.coloursAll }}
{{- /* convert the key variable from camelCase into -separated */ -}}
{{ $variable = replaceRE "([a-z])([A-Z])" "$1-$2" $variable }}
{{- /* make the variable lowercase */ -}}
--{{ lower $variable }}: {{ $value }};
{{ end }}
}
\ No newline at end of file
}
{{- /* all other available colour palettes */ -}}
{{- /* get all available colour palettes */ -}}
{{- $coloursBlue := .Site.Data.colourThemes.themes.coloursBlue.json }}
{{- /* range through all colour palettes */ -}}
{{- /* set the data-colour-theme selector using the colour name as the value */ -}}
[data-colour-theme="{{ .Site.Data.colourThemes.themes.coloursBlue.themeColourName }}"] {
{{- /* range through all the key value pairs in the colour palette json file */ -}}
{{ range $variable, $value := .Site.Data.colourThemes.themes.coloursBlue }}
{{- /* convert the key variable from camelCase into -separated */ -}}
{{ $variable = replaceRE "([a-z])([A-Z])" "$1-$2" $variable }}
{{- /* make the variable lowercase */ -}}
--{{ lower $variable }}: {{ $value }};
{{ end }}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment