Skip to content

Commit

Permalink
Release 2.2.1 (#60)
Browse files Browse the repository at this point in the history
* docs: add Resources nav link

* 2.2.1

* fix(docs): typo in grid styles and add nav for resources (#59)

* fix(docs): typo in grid styles and add nav for resources

* Update docs/_includes/base.njk

Co-authored-by: Shawn Allen <[email protected]>

Co-authored-by: Shawn Allen <[email protected]>

* docs: reorder Resources link, tweak nav templates

Co-authored-by: Jackson Flint-Gonzales <[email protected]>
  • Loading branch information
shawnbot and Jackson Flint-Gonzales authored Dec 17, 2021
1 parent f80e010 commit 23ea224
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 57 deletions.
13 changes: 4 additions & 9 deletions docs/_includes/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
layout: skeleton
---

{% from 'nav.njk' import nav_link with context %}
{% set nav %}
{{ nav_link('/', false) }}
{{ nav_link('/foundations') }}
{{ nav_link('/components') }}
{{ nav_link('/usage') }}
{% endset %}
{% from 'macros.njk' import nav_link with context %}
{% set nav %}{% include 'nav.njk' %}{% endset %}

{% set toc = content | toc %}

Expand All @@ -23,12 +18,12 @@ layout: skeleton
<div class="z-50 pointer-events-none responsive-container fixed h-full top-0 left-0 right-0 opacity-10">
<div class="responsive-grid grid md:hidden h-full">
{% for i in range(0, 6) %}
<div style="background-color: '#FF0000'"></div>
<div style="background-color: #FF0000"></div>
{% endfor %}
</div>
<div class="responsive-grid hidden md:grid h-full">
{% for i in range(0, 12) %}
<div style="background-color: '#FF0000'"></div>
<div style="background-color: #FF0000"></div>
{% endfor %}
</div>
</div>
Expand Down
46 changes: 46 additions & 0 deletions docs/_includes/macros.njk
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
{% macro nav_link(url, deep=true) %}
{% set node = url | node(collections.all) %}
{% set children = node.data.page | children(collections.all) %}
<div class="mb-20">
<a
class="flex justify-center title-xs no-underline mb-20"
href="{{ url }}"
{% if node.data.page.url === page.url %}
aria-current="page"
{% endif %}
>
<div class="flex-auto">{{ node.data.title }}</div>
<div>
{% if deep and children.length %}
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon>
{% endif %}
</div>
</a>
{% if deep %}
{% if url === '/' %}
{% set parent_active = page.url === url %}
{% else %}
{% set parent_active = page.url.startsWith(url) %}
{% endif %}
{% if parent_active %}
<ul class="m-0 p-0 list-none">
{% for child in children %}
{% set child_active = child.url === page.url %}
<li class="pl-16 m-0 mb-20 {{ 'bg-slate-2 rounded-4' if child_active }}">
<a
href="{{ child.url }}"
{% if child_active %}
aria-current="page"
{% endif %}
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}"
>
{{ child.data.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
</div>
{% endmacro %}

{% macro swatch(color, width, height) %}
<div class="mr-20 mb-20">
<h4 class="title-xs mt-0 mb-4">
Expand Down
50 changes: 5 additions & 45 deletions docs/_includes/nav.njk
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
{% macro nav_link(url, deep=true) %}
{% set node = url | node(collections.all) %}
{% set children = node.data.page | children(collections.all) %}
<div class="mb-20">
<a
class="flex justify-center title-xs no-underline mb-20"
href="{{ url }}"
{% if node.data.page.url === page.url %}
aria-current="page"
{% endif %}
>
<div class="flex-auto">{{ node.data.title }}</div>
<div>
{% if deep and children.length %}
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon>
{% endif %}
</div>
</a>
{% if deep %}
{% if url === '/' %}
{% set parent_active = page.url === url %}
{% else %}
{% set parent_active = page.url.startsWith(url) %}
{% endif %}
{% if parent_active %}
<ul class="m-0 p-0 list-none">
{% for child in children %}
{% set child_active = child.url === page.url %}
<li class="pl-16 m-0 mb-20 {{ 'bg-slate-2 rounded-4' if child_active }}">
<a
href="{{ child.url }}"
{% if child_active %}
aria-current="page"
{% endif %}
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}"
>
{{ child.data.title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
{% endif %}
</div>
{% endmacro %}
{{ nav_link('/', false) }}
{{ nav_link('/foundations') }}
{{ nav_link('/components') }}
{{ nav_link('/resources') }}
{{ nav_link('/usage') }}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sfgov-design-system",
"version": "2.2.0",
"version": "2.2.1",
"repository": "SFDigitalServices/design-system",
"author": "City & County of San Francisco, California",
"license": "MIT",
Expand Down

0 comments on commit 23ea224

Please sign in to comment.