-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement new layout + grid breakpoints (#52)
* enable gap + column tailwind plugins * add 96px spacing step * [breaking] change "lg" breakpoint to "md"; add "xl" * add gap, grid, and margin (w/"gutter-auto") to tw theme * add grid.css, .responsive-grid + .responsive-container * fix title of fullscreen example link * stub out responsive grid + container examples * add back m*-auto * add "1/1" width and reorder keys * add breakpoints to "width" utilities (w-lg, etc.) * add h*-auto * add support for wrapper_class="..." in code blocks; nix margin on responsive-container example * delete hidden node dump comment from example template * better whitespace in spacing examples * delete empty "Position" heading from spacing docs * simplify theme.js, add more gridColumns and gridTemplateColumns entries * fix up .responsive-container margins * nix mx-gutter-auto utility * enable gridRow + gridTemplateRows in Tailwind * add theme specs for gridRow + gridTemplateRows * Update src/theme.js * add deprecate comments to bad spacing values * add todo column for line heights in spacing scale * nix unnecessary lg:grid-cols-12 in .responsive-grid * add width tokens, use in maxWidth + width theme * BREAKING CHANGE: update breakpoints The new breakpoints are intended to allow for layout adjustments at common viewport widths. * fix(typography): add .title-sm/-xs defaults * chore(dev): watch assets in "develop" script * Revert "[breaking] change "lg" breakpoint to "md"; add "xl"" This reverts commit cbd778f. * feat: add new "md" breakpoint (420px) * bring in modal dialog element for mobile nav * add z-index utilities * import dialog modal * add base grid utilities * add column utilities and displays for responsive layout * implement dialog modal for mobile nav * remove default marker styles * change colors, move implementations out * nav implementation, add responsive features * decouple header from nav, temporarily hide pkg info on lg * change link colors * refactor for grid/responsive utilities * add margin above footer * refine classes and remove repo links * create separate component for repo links * remove grid utilities from <body> * apply margin only on lg screens * Revert "BREAKING CHANGE: update breakpoints" This reverts commit 1cb2758. * move dialog package to devDependencies * change to flex header for consistent spacing * fix(grid): change .responsive-container max-width The max-w-lg class is preventing the responsive container from reaching its full (xl) width. It should be max-w-xl. * docs(grid): add figma link, row-span utils * inherit some babel changes * add pointerEvents and opacity utilities * add grid overlay functionality * install hotkey * rename script * remove lint-js for now * another fix * fix(grid): change .responsive-container max-width The max-w-lg class is preventing the responsive container from reaching its full (xl) width. It should be max-w-xl. * update package.json * fix(grid): refactor overlay * fix(grid): remove unused variable * fix(color): add red token for grid overlay * fix(accessibility): add aria-labels and roles * fix(deps): npm audit fix * chore: fix up dangling comment Co-authored-by: Shawn Allen <[email protected]>
- Loading branch information
Showing
6 changed files
with
96 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 & 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 & 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> | ||
</a> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
{{ nav_link('/', false) }} | ||
{{ nav_link('/foundations') }} | ||
{{ nav_link('/components') }} | ||
{{ nav_link('/resources') }} | ||
{{ nav_link('/usage') }} | ||
{% 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 %} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters