access-nyc-patterns
Version:
User Interface Patterns for Benefits Access
194 lines (188 loc) • 11.4 kB
HTML
<html class="bg-color-white text-size-0" lang="en">
<head>
<meta charset="utf-8" />
<meta content="IE=edge" http-equiv="X-UA-Compatible" />
<meta content="width=device-width, initial-scale=1" name="viewport" />
<link href="styles/site-default.css" rel="stylesheet" />
<title>Utilities | ACCESS NYC Patterns</title>
<noscript>
<style>
body {
visibility: visible ;
}
</style>
</noscript>
<script type="text/javascript">
function load() {
document.body.style.visibility = 'visible'
};
</script>
</head>
<body class="bg-color-white" onload="load()" style="visibility: hidden;">
<a class="sr-only" href="#main-content">Skip to main content</a>
<div class="min-h-screen">
<header class="px-2">
<div class="border-b border-color-grey-light">
<div class="flex items-center justify-between p-2 screen-tablet:py-4 screen-tablet:px-2">
<div>
<h1 class="m-0 p-0 leading-normal">
<a href="index"><span class="hidden">ACCESS NYC</span>
<svg aria-hidden="true" class="icon-logo-mark screen-tablet:hidden">
<use xlink:href="#icon-logo-mark"></use>
</svg>
<svg aria-hidden="true" class="icon-logo-full--large text-color-blue-dark hidden screen-tablet:inline-block">
<use xlink:href="#icon-logo-full"></use>
</svg>
</a>
</h1>
</div>
<div class="flex items-center">
<h2 class="text-font-size-small m-0 text-color-blue-dark screen-tablet:hidden">Patterns</h2>
<h2 aria-hidden="true" class="type-h1 m-0 text-color-blue-dark hidden screen-tablet:inline-block">Patterns</h2>
<nav class="text-font-size-small">
<a class="rounded-lg text-color-blue-dark border-2 no-underline px-1 ml-2 hidden screen-tablet:inline-block" href="https://github.com/CityOfNewYork/ACCESS-NYC-PATTERNS">0.0.11-11</a>
<a aria-hidden="true" class="ml-1 screen-tablet:ml-2 screen-tablet:hidden" href="https://github.com/CityOfNewYork/ACCESS-NYC-PATTERNS">0.0.11-11</a>
<a class="ml-1 screen-tablet:ml-2" data-js="toggle" href="#main-menu">Menu</a>
</nav>
</div>
</div>
</div>
</header>
<aside aria-hidden="true" class="text-font-size-small bg-color-blue-light hidden hidden:overflow animated" id="main-menu" style="position:relative;top:-1px">
<div class="page-wrapper py-4">
<div class="screen-tablet:flex">
<nav class="screen-tablet:flex-1 mb-1 px-2"><span class="type-h3 text-font-size-small mb-1 block screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1">Main</span>
<a class="block p-1" href="index">Home</a>
<a class="block p-1" href="about">About</a>
<a class="block p-1" href="installation">Installation</a>
<a class="block p-1" href="design-tools">Design Tools</a>
<a class="block p-1 screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1" href="developer-tools">Developer Tools</a>
<a class="block p-1" href="https://www.npmjs.com/package/access-nyc-patterns">NPM</a>
<a class="block p-1" href="https://github.com/CityOfNewYork/ACCESS-NYC-PATTERNS">GitHub</a>
</nav>
<nav class="screen-tablet:flex-1 mb-1 px-2 screen-desktop:pl-4"><span class="type-h3 text-font-size-small mb-1 block screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1">Elements</span>
<a class="block p-1" href="buttons">Buttons</a>
<a class="block p-1" href="checkboxes">Checkboxes</a>
<a class="block p-1" href="dividers">Dividers</a>
<a class="block p-1" href="inputs">Inputs</a>
<a class="block p-1" href="layouts">Layouts</a>
<a class="block p-1" href="links">Links</a>
<a class="block p-1" href="lists">Lists</a>
<a class="block p-1" href="nav">Nav</a>
<a class="block p-1" href="program-labels">Program Labels</a>
<a class="block p-1" href="radios">Radios</a>
<a class="block p-1" href="tables">Tables</a>
<a class="block p-1" href="tooltips">Tooltips</a>
<a class="block p-1" href="toggles">Toggles</a>
<a class="block p-1" href="selects">Selects</a>
</nav>
<nav class="screen-tablet:flex-1 mb-1 px-2 screen-desktop:pl-4"><span class="type-h3 text-font-size-small mb-1 block screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1">Components</span>
<a class="block p-1" href="accordion">Accordion</a>
<a class="block p-1" href="alert-box">Alert Box</a>
<a class="block p-1" href="card">Card</a>
<a class="block p-1" href="checklist">Checklist</a>
<a class="block p-1" href="disclaimer">Disclaimer</a>
<a class="block p-1" href="filter">Filter</a>
<a class="block p-1" href="header">Header</a>
<a class="block p-1" href="member-list">Member List</a>
<a class="block p-1" href="nearby-stops">Nearby Stops</a>
<a class="block p-1" href="share-form">Share Form</a>
<a class="block p-1" href="side-nav">Side Nav</a>
<a class="block p-1" href="text-controller">Text Controller</a>
<a class="block p-1" href="question">Question</a>
</nav>
<nav class="screen-tablet:flex-1 mb-1 px-2 screen-desktop:pl-4"><span class="type-h3 text-font-size-small mb-1 block screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1">Objects</span>
<a class="block p-1" href="announcements">Announcements</a>
<a class="block p-1" href="banner">Banner</a>
<a class="block p-1" href="card-list">Card Lists</a>
<a class="block p-1" href="content">Content</a>
<a class="block p-1" href="footer">Footer</a>
<a class="block p-1" href="mobile-nav">Mobile Nav</a>
<a class="block p-1" href="navigation">Navigation</a>
<a class="block p-1" href="search-box">Search Box</a>
</nav>
<nav class="screen-tablet:flex-1 mb-1 px-2 screen-desktop:pl-4">
<a class="type-h3 text-font-size-small mb-1 block screen-tablet:border-b screen-tablet:pb-2 screen-tablet:mb-1 border-color-white p-1" href="utilities">Utilities</a>
<a class="block p-1" href="colors">Colors</a>
<a class="block p-1" href="font">Fonts</a>
<a class="block p-1" href="icons">Icons</a>
<a class="block p-1" href="text">Text</a>
<a class="block p-1" href="typography">Typography</a>
<a class="block p-1" href="language">Language</a>
<a class="block p-1" href="accessibility">Accessibility</a>
<a class="block p-1" href="media">Media</a>
<a class="block p-1" href="display">Display</a>
</nav>
</div>
<div class="text-center">
<a data-js="toggle" href="#main-menu">Close Menu</a>
</div>
</div>
</aside>
<main class="pt-4" id="main-content">
<article class="pt-4">
<header class="page-wrapper px-2 screen-desktop:px-0 layout--home-body">
<div class="my-0 w-full">
<h1 class="text-color-blue-dark px-2 m-0">Utilities</h1>
</div>
</header>
<section class="pb-4 mb-4">
<div class="page-wrapper">
<header class="layout--home-body">
<div class="my-0 pt-1 px-2 border-b border-color-grey-light"></div>
</header>
<div class="layout--home-body">
<div class="px-2 text-font-size-small">
<div class="o-content color-light-background pb-4"><p>Utilities allow the flexibility to change specific properties of every Pattern in certain views. For example, if a Pattern is set to <code>display: block</code> in one view but in another it needs to be set to <code>display: inline</code>, one solution
would be to create another type of the Pattern. However, a UI developer may need to repeat this process for other Patterns.</p>
<p>A Utility class, such as Tailwind’s <code>.inline</code>
<a href="https://tailwindcss.com/docs/display">display utility</a>, allows the developer to reuse this attribute without creating a different pattern type. This use case can be extended to every possible CSS attribute, such as color, position, font-families, margin, padding, etc. In addition, they
can be bundled within media queries so certain utilities can work for specific screen sizes.</p>
<p>ACCESS NYC Patterns integrates the
<a href="https://tailwindcss.com">Tailwind Utility Framework</a>, a library processed by
<a href="https://postcss.org/">PostCSS</a> that allows for a
<a href="https://tailwindcss.com/docs/configuration">specific configuration</a>. To get started using the Patterns utilities look at the Tailwind documentation along with the
<a href="https://github.com/CityOfNewYork/ACCESS-NYC-PATTERNS/blob/master/config/tailwind.js">configuration file of this library</a>. By default, not all properties are enabled so it’s important to be familiar with the configuration.</p>
<p>Documentation for some of the most critical and customized Utilities exist here, but developers should refer to the
<a href="https://tailwindcss.com/docs/">Tailwind Documentation</a> for further details.</p></div>
</div>
</div>
</div>
</section>
</article>
</main>
</div>
<footer class="py-4 text-center color-dark-background">
<p>
<nav>
<a class="px-1" href="index">Home</a>
<a class="px-1" href="about">About</a>
<a class="px-1" href="installation">Installation</a>
<a class="px-1" href="design-tools">Design Tools</a>
<a class="px-1" href="developer-tools">Developer Tools</a>
</nav>
</p>
<p>Maintained by
<a href="https://nyc.gov/opportunity">NYC Opportunity</a>
</p>
<p class="m-0">
<nav>
<a class="px-1" href="https://github.com/orgs/CityOfNewYork/teams/nycopportunity">GitHub</a>
<a class="px-1" href="https://twitter.com/nycopportunity">Twitter</a>
<a class="px-1" href="https://www.facebook.com/NYCOpportunity">Facebook</a>
<a class="px-1" href="https://www.instagram.com/nycopportunity">Instagram</a>
</nav>
</p>
</footer>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=fetch,Element.prototype.matches,Promise&flags=gated"></script>
<script src="scripts/AccessNyc.js"></script>
<script src="scripts/markdown.min.js"></script>
<script type="text/javascript">
var access = new AccessNyc();
access.markdown();
access.icons();
access.toggle();
</script>
</body>
</html>