瀏覽代碼

make 'customVars' accessible as CSS-variables

master
Dom SP 3 年之前
父節點
當前提交
6456d5676e
共有 3 個文件被更改,包括 14 次插入2 次删除
  1. +6
    -0
      app/views/colors.css
  2. +3
    -1
      main.cfg.sample
  3. +5
    -1
      rsc/sass/_colours.scss

+ 6
- 0
app/views/colors.css 查看文件

@@ -6,3 +6,9 @@ html {
background-attachment: fixed;
background-size: 2000px 2000px;
}

<repeat group="{{ @customVars }}" key="{{ @ikey }}" value="{{ @ivalue }}">
:root {
--{{ @ikey }}: {{ $@ikey }};
}
</repeat>

+ 3
- 1
main.cfg.sample 查看文件

@@ -25,7 +25,9 @@ includeBanner=false
;; "customVars" are global (in F3) and can be changed in content files
[customVars]
backgroundColor=#fff
info1=test
color1=#333
color2=#777
color3=#bbb

[globals]
title=Title of new Page

+ 5
- 1
rsc/sass/_colours.scss 查看文件

@@ -3,7 +3,11 @@ $white:#fff;
$black:#000;
$gray:#777;


:root {
--color1: red;
--color2: green;
--color3: blue;
}

html {
color:$gray;

Loading…
取消
儲存