diff --git a/_includes/moon.svg b/_includes/moon.svg new file mode 100644 index 0000000..6d08443 --- /dev/null +++ b/_includes/moon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/_layouts/designlist.html b/_layouts/designlist.html index b925282..b1399d9 100644 --- a/_layouts/designlist.html +++ b/_layouts/designlist.html @@ -88,7 +88,7 @@ layout: default {%- comment -%}{%- endcomment -%} - {%- assign heading_text = record.name -%} + {% assign heading_text = record.name %} {% if record.alias and record.alias.size %} {% capture heading_text %}{{ record.alias | join: ', ' | prepend: ' (' | prepend: record.name | append: ')' }}{% endcapture %} {% for alias in record.alias -%} @@ -102,12 +102,18 @@ layout: default {% if record.tags -%}
{%- for tag in record.tags -%} - {% endfor -%}
+ {% endfor %} {% endif %} {%- comment -%}{%- endcomment -%} -{{ record.sample | escape }}
+ {%- if record.tags and record.tags contains "color" -%}
+ + {%- else -%} +{{ record.sample }}
{%- include moon.svg -%}
{{ record.sample | escape }}
+ {% endif %}
{%- comment -%}{%- endcomment -%}
diff --git a/_sass/_boxes.scss b/_sass/_boxes.scss index a401f30..f7d7304 100644 --- a/_sass/_boxes.scss +++ b/_sass/_boxes.scss @@ -143,6 +143,35 @@ code { } +/* + * Light/Dark Background Toggle in Design Explorer + */ +pre.bxBgToggle { + position: relative; + div { + position: absolute; + right: $spacer/2; + top: $spacer/2; + svg { + fill: $headings-color !important; + } + &:hover { + cursor: pointer; + svg { + fill: $primary !important; + } + } + } + &.bxDark { + background-color: $dark; + color: $light; + code { + background-color: $dark; + } + } +} + + /* * Images */