Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new layout + grid breakpoints #52

Merged
merged 71 commits into from
Dec 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
3058134
enable gap + column tailwind plugins
shawnbot Sep 29, 2021
f096c5e
add 96px spacing step
shawnbot Sep 29, 2021
cbd778f
[breaking] change "lg" breakpoint to "md"; add "xl"
shawnbot Sep 29, 2021
cda62fb
add gap, grid, and margin (w/"gutter-auto") to tw theme
shawnbot Sep 29, 2021
2c11250
add grid.css, .responsive-grid + .responsive-container
shawnbot Sep 29, 2021
41106df
fix title of fullscreen example link
shawnbot Sep 29, 2021
50750c2
stub out responsive grid + container examples
shawnbot Sep 29, 2021
2dd05b6
add back m*-auto
shawnbot Sep 30, 2021
ab68b14
add "1/1" width and reorder keys
shawnbot Sep 30, 2021
4eb7548
add breakpoints to "width" utilities (w-lg, etc.)
shawnbot Sep 30, 2021
727b715
add h*-auto
shawnbot Sep 30, 2021
44bb85b
add support for wrapper_class="..." in code blocks; nix margin on res…
shawnbot Sep 30, 2021
b47b957
delete hidden node dump comment from example template
shawnbot Oct 1, 2021
b3fb878
better whitespace in spacing examples
shawnbot Oct 1, 2021
35b47d6
delete empty "Position" heading from spacing docs
shawnbot Oct 1, 2021
05836e5
simplify theme.js, add more gridColumns and gridTemplateColumns entries
shawnbot Oct 1, 2021
97ae3ab
fix up .responsive-container margins
shawnbot Oct 1, 2021
cbd06c5
nix mx-gutter-auto utility
shawnbot Oct 1, 2021
6f334d5
enable gridRow + gridTemplateRows in Tailwind
shawnbot Oct 4, 2021
6b428d7
add theme specs for gridRow + gridTemplateRows
shawnbot Oct 4, 2021
62ef75b
Update src/theme.js
Oct 5, 2021
be99873
add deprecate comments to bad spacing values
shawnbot Oct 5, 2021
26ad1c0
add todo column for line heights in spacing scale
shawnbot Oct 5, 2021
17dfc3e
nix unnecessary lg:grid-cols-12 in .responsive-grid
shawnbot Oct 6, 2021
3d296c9
Merge branch 'release-2.2.0' into grid
shawnbot Oct 14, 2021
99311c2
add width tokens, use in maxWidth + width theme
shawnbot Oct 25, 2021
1cb2758
BREAKING CHANGE: update breakpoints
shawnbot Oct 25, 2021
5c99261
fix(typography): add .title-sm/-xs defaults
shawnbot Oct 26, 2021
27b98d4
chore(dev): watch assets in "develop" script
shawnbot Oct 26, 2021
4446ebb
Revert "[breaking] change "lg" breakpoint to "md"; add "xl""
shawnbot Nov 2, 2021
31cc9cb
feat: add new "md" breakpoint (420px)
shawnbot Nov 2, 2021
8e1d7c6
bring in modal dialog element for mobile nav
Nov 2, 2021
5a87229
add z-index utilities
Nov 2, 2021
e803503
import dialog modal
Nov 2, 2021
4e5d171
add base grid utilities
Nov 2, 2021
a50d7b4
add column utilities and displays for responsive layout
Nov 2, 2021
ef2e401
implement dialog modal for mobile nav
Nov 2, 2021
a6535a5
remove default marker styles
Nov 2, 2021
67e8df9
change colors, move implementations out
Nov 9, 2021
5744a37
nav implementation, add responsive features
Nov 9, 2021
61f23aa
decouple header from nav, temporarily hide pkg info on lg
Nov 9, 2021
dc3fdc3
change link colors
Nov 9, 2021
5e3ef1b
refactor for grid/responsive utilities
Nov 10, 2021
bcaa376
add margin above footer
Nov 10, 2021
5822cdd
refine classes and remove repo links
Nov 10, 2021
5a29f7e
create separate component for repo links
Nov 10, 2021
294f5d9
remove grid utilities from <body>
Nov 10, 2021
ec0507e
apply margin only on lg screens
Nov 10, 2021
f652f62
Revert "BREAKING CHANGE: update breakpoints"
Nov 10, 2021
08706dc
move dialog package to devDependencies
Nov 23, 2021
79e9aae
change to flex header for consistent spacing
Nov 24, 2021
f85e566
fix(grid): change .responsive-container max-width
shawnbot Nov 30, 2021
00b31b7
docs(grid): add figma link, row-span utils
shawnbot Nov 30, 2021
b8f8d1e
inherit some babel changes
Dec 3, 2021
07e8c99
add pointerEvents and opacity utilities
Dec 3, 2021
55ff546
add grid overlay functionality
Dec 3, 2021
e92a5ae
install hotkey
Dec 3, 2021
1741911
rename script
Dec 3, 2021
75cb067
remove lint-js for now
Dec 3, 2021
075b608
another fix
Dec 3, 2021
3b53b0c
fix(grid): change .responsive-container max-width
shawnbot Nov 30, 2021
de568eb
Merge branch 'release-2.2.0' into grid
shawnbot Dec 3, 2021
83ce37c
update package.json
Dec 4, 2021
87c4698
Merge branch 'grid' into grid-breakpoints
Dec 6, 2021
513c5eb
fix(grid): refactor overlay
Dec 6, 2021
a1597ba
fix(grid): remove unused variable
Dec 6, 2021
797322e
fix(color): add red token for grid overlay
Dec 7, 2021
9b9bc74
fix(accessibility): add aria-labels and roles
Dec 7, 2021
854989b
fix(deps): npm audit fix
shawnbot Dec 8, 2021
198893f
chore: fix up dangling comment
shawnbot Dec 8, 2021
223ee49
Merge remote-tracking branch 'origin/release-2.2.0' into grid-breakpo…
shawnbot Dec 8, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 69 additions & 26 deletions docs/_includes/base.njk
Original file line number Diff line number Diff line change
@@ -1,37 +1,80 @@
---
layout: skeleton
---
{% include 'header.njk' %}

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

{% set toc = content | toc %}

{% block main %}
<div class="px-20 max-w-xl mx-auto mt-40 mb-100">
<div class="lg:flex justify-end">
<div class="lg:w-1/4 lg:mr-60 mb-40">
{% block nav %}
{% include 'nav.njk' %}
{% endblock %}
</div>
<div class="lg:w-3/4">
{% block content %}
{% include 'title.njk' %}
{% if toc %}
<div class="flex justify-start flex-row-reverse">
<div class="none lg:block lg:w-1/4 mb-40 ml-40">
{% include 'toc.njk' %}
</div>
<div class="lg:w-3/4">
{% include 'main.njk' %}
</div>
</div>
{% else %}
{% include 'main.njk' %}
{% endif %}
{% endblock %}
{% include 'source-meta.njk' %}
<div class="bg-grey-1">
<div class="responsive-container flex justify-between py-8">
<details>
<summary
data-hotkey="Control+g"
aria-label="press Control+g to enable the grid overlay"
class="text-slate-light font-mono"
>Press <kbd>Control</kbd> + <kbd>G</kbd> to toggle grid overlay</summary>
<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 class="bg-red-grid"></div>
{% endfor %}
</div>
<div class="responsive-grid hidden md:grid h-full">
{% for i in range(0, 12) %}
<div class="bg-red-grid"></div>
{% endfor %}
</div>
</div>
</details>
<div>
{% include 'repo-links.njk' %}
</div>
</div>
</div>

<div class="responsive-container flex lg:hidden mt-60 mb-28 items-center">
<details>
<summary role="navigation" aria-label="open navigation menu">
<sfgov-icon class="pr-20" symbol="menu" role="img" aria-label="hamburger menu"></sfgov-icon>
</summary>
<details-dialog class="top-0 left-0 w-full h-full fixed p-20 bg-grey-1 z-50 max-w-sm">
<sfgov-icon class="py-20 block mt-96 ml-8" symbol="close" role="img" aria-label="x" data-close-dialog></sfgov-icon>
{{ nav | safe }}
</details-dialog>
</details>

<header>
{% include 'header.njk' %}
</header>
</div>

{% block main %}
<div class="responsive-grid responsive-container grid-rows-2">
<div class="hidden lg:block lg:row-span-full lg:col-span-3">
{% include 'header.njk' %}
{{ nav | safe }}
</div>
<div class="col-span-full lg:col-span-9 lg:mt-48">
{% include 'title.njk' %}
</div>
<div class="col-span-full lg:col-span-9 {% if toc %} xl:col-span-6 {% endif %}">
{% block content %}
{% include 'main.njk' %}
{% endblock %}
{% include 'source-meta.njk' %}
</div>
{% if toc %}
<div class="hidden xl:block xl:col-span-3">
{% include 'toc.njk' %}
</div>
{% endif %}
</div>
{% endblock %}

Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/footer.njk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="py-60 bg-black text-white">
<footer class="col-span-6 md:col-span-12 mt-80 py-60 bg-black text-white">
<div class="max-w-xl mx-auto">
<div class="flex items-start">
<div class="w-1/2 flex items-center">
Expand Down
42 changes: 10 additions & 32 deletions docs/_includes/header.njk
Original file line number Diff line number Diff line change
@@ -1,33 +1,11 @@
<header>
<div class="px-20 max-w-xl mx-auto py-20 lg:py-48">
<div class="flex items-center justify-between">
<a class="flex items-center no-underline" href="/">
<img
alt="City &amp; County of San Francisco"
class="block"
height="60"
src="https://sf.gov/themes/custom/sfgovpl/logo.svg">
<div class="pl-16">
<div class="title-sm text-slate mt-2">{{ site.title }}</div>
</div>
</a>
<div class="flex items-center">
<div>
<a
href="{{ '/' | published_url(package.version) }}"
class="text-slate-light font-mono no-underline"
>{{ package.name }}@{{ package.version }}</a>

<a
class="text-slate-light font-medium no-underline ml-24"
href="{{ '' | repo_url }}"
>
<svg style="fill: currentColor;" class="align-middle inline-block mr-2 mb-4" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
GitHub
</a>
</div>
{# % include 'search.njk' % #}
</div>
<div class="max-w-xl mx-auto py-20 lg:py-48">
<a class="flex items-center no-underline" href="/">
<img
alt="City &amp; County of San Francisco"
class="block h-48 w-48"
src="https://sf.gov/themes/custom/sfgovpl/logo.svg">
<div class="pl-16">
<div class="title-xs text-slate mt-2">{{ site.title }}</div>
</div>
</div>
</header>
</a>
</div>
12 changes: 3 additions & 9 deletions docs/_includes/nav.njk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="flex-auto">{{ node.data.title }}</div>
<div>
{% if deep and children.length %}
<sfgov-icon symbol="chevron-down"></sfgov-icon>
<sfgov-icon symbol="chevron-down" role="img" aria-label="arrow pointing down"></sfgov-icon>
{% endif %}
</div>
</a>
Expand All @@ -26,13 +26,13 @@
<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">
<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 text-slate no-underline {{ 'font-medium' if child_active }}"
class="block no-underline {{ 'text-white' if child_active else 'text-slate-4' }}"
>
{{ child.data.title }}
</a>
Expand All @@ -43,9 +43,3 @@
{% endif %}
</div>
{% endmacro %}

{{ nav_link('/', false) }}
{{ nav_link('/foundations') }}
{{ nav_link('/components') }}
{{ nav_link('/resources') }}
{{ nav_link('/usage') }}
16 changes: 16 additions & 0 deletions docs/_includes/repo-links.njk
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<div class="inline-flex flex-wrap">
<a
href="{{ '/' | published_url(package.version) }}"
class="text-slate-light font-mono no-underline"
>{{ package.name }}@{{ package.version }}</a>
</div>

<div class="inline-flex flex-wrap">
<a
class="text-slate-light font-medium no-underline ml-24"
href="{{ '' | repo_url }}"
>
<svg style="fill: currentColor;" class="align-middle inline-block mr-2 mb-4" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"></path></svg>
GitHub
</a>
</div>
Loading