浏览代码

fix: Conditionally set css variables

version-14
Suraj Shetty 4 年前
父节点
当前提交
38efba692d
共有 1 个文件被更改,包括 12 次插入8 次删除
  1. +12
    -8
      frappe/website/doctype/website_theme/website_theme_template.scss

+ 12
- 8
frappe/website/doctype/website_theme/website_theme_template.scss 查看文件

@@ -1,13 +1,13 @@
{% if google_font %} {% if google_font %}
@import url("https://fonts.googleapis.com/css2?family={{ google_font.replace(' ', '+') }}:{{ font_properties }}&display=swap"); @import url("https://fonts.googleapis.com/css2?family={{ google_font.replace(' ', '+') }}:{{ font_properties }}&display=swap");
$font-family-sans-serif: "{{ google_font }}", -apple-system, BlinkMacSystemFont, $font-family-sans-serif: "{{ google_font }}", -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;
"Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans",
"Droid Sans", "Helvetica Neue", sans-serif;
{% endif -%} {% endif -%}


{% if primary_color %}$primary: {{ frappe.db.get_value('Color', primary_color, 'color') }};{% endif -%} {% if primary_color %}$primary: {{ frappe.db.get_value('Color', primary_color, 'color') }};{% endif -%}
{% if dark_color %}$dark: {{ frappe.db.get_value('Color', dark_color, 'color') }};{% endif -%} {% if dark_color %}$dark: {{ frappe.db.get_value('Color', dark_color, 'color') }};{% endif -%}
{% if text_color %}$body-color: {{ frappe.db.get_value('Color', text_color, 'color') }};{% endif -%}
{% if text_color %}$body-text-color: {{ frappe.db.get_value('Color', text_color, 'color') }};{% endif -%}
{% if background_color %}$body-bg: {{ frappe.db.get_value('Color', background_color, 'color') }};{% endif -%} {% if background_color %}$body-bg: {{ frappe.db.get_value('Color', background_color, 'color') }};{% endif -%}


$enable-shadows: {{ button_shadows and "true" or "false" }}; $enable-shadows: {{ button_shadows and "true" or "false" }};
@@ -24,7 +24,7 @@ $enable-rounded: {{ button_rounded_corners and "true" or "false" }};


{% if font_size -%} {% if font_size -%}
body { body {
font-size: {{ font_size }};
font-size: {{ font_size }};
} }
{%- endif %} {%- endif %}


@@ -32,12 +32,16 @@ body {
{{ custom_scss or '' }} {{ custom_scss or '' }}


:root { :root {
{% if primary_color %}
--primary: #{$primary}; --primary: #{$primary};
--primary-color: #{$primary}; --primary-color: #{$primary};
--primary-light: #{$primary-light};
--light: #{$light};
{% endif -%}
{% if background_color %}
--bg-color: #{$body-bg}; --bg-color: #{$body-bg};
--text-color: #{$body-color};
--text-light: #{$body-color};
{% endif -%}
{% if text_color %}
--text-color: #{$body-text-color};
--text-light: #{$body-text-color};
{% endif -%}
} }



正在加载...
取消
保存