The ACCESS NYC Patterns integrate tailwindcss, a CSS utility-first framework processed by PostCSS that supports custom configuration. Below is a table describing the current configuration.
A simple example for using a utility to add padding to an element would be to use the utility .p-1
. This will add 8px
of padding on all sides of an element.
.p-1 {
padding: 8px
}
<div class="p-1"></div>
Configuration
There are three parts to the tailwindcss configuration.
-
Theme: This object contains customizations for particular utilities such as font families, colors, margin, padding, etc. Source documentation.
-
Variants: This object contains variants that represent different states that the utilities appear in such as media queries,
:hover
, and :focus
states. Source documentation.
-
Core Plugins: This array is a white list of utility plugins that defines what sets of utilities will be compiled in the final stylesheet distribution. Source documentation.
Theme
Example; the padding plugin is customized to use 8px
as the basis for all padding increments. .p-2
would add 8px × 2 = 16px
padding on all sides of an element.
<div class="p-2"></div>
Colors are part of the theme configuration but are described in more detail in the Color Utility documentation.
Variants
Example; to have padding only appear for desktop screens within NYCO Patterns the prefix screen-desktop:
is added to the .p-1
utility.
<div class="screen-desktop:p-1"></div>
The plugin table below describes the available variants for each utility. An empty array []
means only the default state is available. The screens theme configuration describes the avaliable break points for the responsive variants.
Core Plugins
Example; the core plugin for padding is padding
. Adding or removing it to the array will determine wether those utilities are compiled to the global stylesheet.
ACCESS NYC × tailwindcss configuration
Theme
Plugin (link to docs)
.{{ prefix }}-blue-light
#C3DDFF
.{{ prefix }}-blue-bright
#118DF0
.{{ prefix }}-blue
#184E9E
.{{ prefix }}-blue-dark
#112E51
.{{ prefix }}-yellow-light
#FFE6A9
.{{ prefix }}-yellow-access
#FBB720
.{{ prefix }}-green-light
#B7ECCF
.{{ prefix }}-green
#05CE7C
.{{ prefix }}-green-mid
#0D6D3B
.{{ prefix }}-green-dark
#094727
.{{ prefix }}-pink-light
#F1B3bD
.{{ prefix }}-pink
#F1647C
.{{ prefix }}-red
#C6252b
.{{ prefix }}-purple
#4C2C92
.{{ prefix }}-covid-response
#803D8D
.{{ prefix }}-covid-response-light
#DAB7E0
.{{ prefix }}-grey-light
#D1D5D9
.{{ prefix }}-grey-lightest
#EEF3F7
.{{ prefix }}-grey-mid
#505C66
.{{ prefix }}-grey-dark
#172129
.{{ prefix }}-black
#000000
.{{ prefix }}-white
#FFFFFF
.{{ prefix }}-transparent
rgba(255, 255, 255, 0)
.{{ prefix }}-inherit
inherit
.{{ prefix }}-eighth-avenue
#2850AD
.{{ prefix }}-sixth-avenue
#FF6319
.{{ prefix }}-crosstown
#6CBE45
.{{ prefix }}-canarsie
#A7A9AC
.{{ prefix }}-nassau
#996633
.{{ prefix }}-broadway
#FCCC0A
.{{ prefix }}-broadway-seventh-avenue
#EE352E
.{{ prefix }}-lexington-avenue
#00933C
.{{ prefix }}-flushing
#B933AD
.{{ prefix }}-shuttles
#808183
.{{ prefix }}-blue-light
#C3DDFF
.{{ prefix }}-blue-bright
#118DF0
.{{ prefix }}-blue
#184E9E
.{{ prefix }}-blue-dark
#112E51
.{{ prefix }}-yellow-light
#FFE6A9
.{{ prefix }}-yellow-access
#FBB720
.{{ prefix }}-green-light
#B7ECCF
.{{ prefix }}-green
#05CE7C
.{{ prefix }}-green-mid
#0D6D3B
.{{ prefix }}-green-dark
#094727
.{{ prefix }}-pink-light
#F1B3bD
.{{ prefix }}-pink
#F1647C
.{{ prefix }}-red
#C6252b
.{{ prefix }}-purple
#4C2C92
.{{ prefix }}-covid-response
#803D8D
.{{ prefix }}-covid-response-light
#DAB7E0
.{{ prefix }}-grey-light
#D1D5D9
.{{ prefix }}-grey-lightest
#EEF3F7
.{{ prefix }}-grey-mid
#505C66
.{{ prefix }}-grey-dark
#172129
.{{ prefix }}-black
#000000
.{{ prefix }}-white
#FFFFFF
.{{ prefix }}-transparent
rgba(255, 255, 255, 0)
.{{ prefix }}-inherit
inherit
.{{ prefix }}-eighth-avenue
#2850AD
.{{ prefix }}-sixth-avenue
#FF6319
.{{ prefix }}-crosstown
#6CBE45
.{{ prefix }}-canarsie
#A7A9AC
.{{ prefix }}-nassau
#996633
.{{ prefix }}-broadway
#FCCC0A
.{{ prefix }}-broadway-seventh-avenue
#EE352E
.{{ prefix }}-lexington-avenue
#00933C
.{{ prefix }}-flushing
#B933AD
.{{ prefix }}-shuttles
#808183
.{{ prefix }}-blue-light
#C3DDFF
.{{ prefix }}-blue-bright
#118DF0
.{{ prefix }}-blue
#184E9E
.{{ prefix }}-blue-dark
#112E51
.{{ prefix }}-yellow-light
#FFE6A9
.{{ prefix }}-yellow-access
#FBB720
.{{ prefix }}-green-light
#B7ECCF
.{{ prefix }}-green
#05CE7C
.{{ prefix }}-green-mid
#0D6D3B
.{{ prefix }}-green-dark
#094727
.{{ prefix }}-pink-light
#F1B3bD
.{{ prefix }}-pink
#F1647C
.{{ prefix }}-red
#C6252b
.{{ prefix }}-purple
#4C2C92
.{{ prefix }}-covid-response
#803D8D
.{{ prefix }}-covid-response-light
#DAB7E0
.{{ prefix }}-grey-light
#D1D5D9
.{{ prefix }}-grey-lightest
#EEF3F7
.{{ prefix }}-grey-mid
#505C66
.{{ prefix }}-grey-dark
#172129
.{{ prefix }}-black
#000000
.{{ prefix }}-white
#FFFFFF
.{{ prefix }}-transparent
rgba(255, 255, 255, 0)
.{{ prefix }}-inherit
inherit
.{{ prefix }}-eighth-avenue
#2850AD
.{{ prefix }}-sixth-avenue
#FF6319
.{{ prefix }}-crosstown
#6CBE45
.{{ prefix }}-canarsie
#A7A9AC
.{{ prefix }}-nassau
#996633
.{{ prefix }}-broadway
#FCCC0A
.{{ prefix }}-broadway-seventh-avenue
#EE352E
.{{ prefix }}-lexington-avenue
#00933C
.{{ prefix }}-flushing
#B933AD
.{{ prefix }}-shuttles
#808183
.{{ prefix }}-up
0 3px 12px 2px rgba(0, 0, 0, 0.25)
.{{ prefix }}-blue-light
#C3DDFF
.{{ prefix }}-blue-bright
#118DF0
.{{ prefix }}-blue
#184E9E
.{{ prefix }}-blue-dark
#112E51
.{{ prefix }}-yellow-light
#FFE6A9
.{{ prefix }}-yellow-access
#FBB720
.{{ prefix }}-green-light
#B7ECCF
.{{ prefix }}-green
#05CE7C
.{{ prefix }}-green-mid
#0D6D3B
.{{ prefix }}-green-dark
#094727
.{{ prefix }}-pink-light
#F1B3bD
.{{ prefix }}-pink
#F1647C
.{{ prefix }}-red
#C6252b
.{{ prefix }}-purple
#4C2C92
.{{ prefix }}-covid-response
#803D8D
.{{ prefix }}-covid-response-light
#DAB7E0
.{{ prefix }}-grey-light
#D1D5D9
.{{ prefix }}-grey-lightest
#EEF3F7
.{{ prefix }}-grey-mid
#505C66
.{{ prefix }}-grey-dark
#172129
.{{ prefix }}-black
#000000
.{{ prefix }}-white
#FFFFFF
.{{ prefix }}-transparent
rgba(255, 255, 255, 0)
.{{ prefix }}-inherit
inherit
.{{ prefix }}-eighth-avenue
#2850AD
.{{ prefix }}-sixth-avenue
#FF6319
.{{ prefix }}-crosstown
#6CBE45
.{{ prefix }}-canarsie
#A7A9AC
.{{ prefix }}-nassau
#996633
.{{ prefix }}-broadway
#FCCC0A
.{{ prefix }}-broadway-seventh-avenue
#EE352E
.{{ prefix }}-lexington-avenue
#00933C
.{{ prefix }}-flushing
#B933AD
.{{ prefix }}-shuttles
#808183
.{{ prefix }}-inherit
inherit
.{{ prefix }}-system
-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif
.{{ prefix }}-sans
"Noto Sans", sans-serif
.{{ prefix }}-serif
"Noto Serif", serif
.{{ prefix }}-kr-sans
"Noto Sans", "Noto Sans CJK KR", sans-serif
.{{ prefix }}-kr-serif
"Noto Serif", "Noto Sans CJK KR", serif
.{{ prefix }}-tc-sans
"Noto Sans", "Noto Sans CJK TC", "Microsoft Yahei", "微软雅黑", STXihei, "华文细黑", sans-serif
.{{ prefix }}-tc-serif
"Noto Serif", "Noto Sans CJK TC", "Microsoft Yahei", "微软雅黑", STXihei, "华文细黑", serif
.{{ prefix }}-ar-sans
"Noto Sans", "Noto Naskh Arabic", sans-serif
.{{ prefix }}-ar-serif
"Noto Serif", "Noto Naskh Arabic", serif
.{{ prefix }}-ur-sans
"Noto Sans", "Noto Nastaliq Urdu", sans-serif
.{{ prefix }}-ur-serif
"Noto Serif", "Noto Nastaliq Urdu", serif
.{{ prefix }}-code
monospace
.{{ prefix }}-inherit
inherit
.{{ prefix }}-xsmall
0.54rem
.{{ prefix }}-small
0.72rem
.{{ prefix }}-normal
1rem
.{{ prefix }}-medium
1.09rem
.{{ prefix }}-large
1.25rem
.{{ prefix }}-larger
1.45rem
.{{ prefix }}-largest
1.81rem
.{{ prefix }}-jumbo
2.54rem
.{{ prefix }}-inherit
inherit
.{{ prefix }}-normal
normal
.{{ prefix }}-100vh
100vh
.{{ prefix }}-inherit
inherit
.{{ prefix }}-screen-desktop
[object Object]
.{{ prefix }}-screen-tablet
[object Object]
.{{ prefix }}-screen-mobile
[object Object]
.{{ prefix }}-screen-sm-mobile
[object Object]
.{{ prefix }}-print
[object Object]
.{{ prefix }}-blue-light
#C3DDFF
.{{ prefix }}-blue-bright
#118DF0
.{{ prefix }}-blue
#184E9E
.{{ prefix }}-blue-dark
#112E51
.{{ prefix }}-yellow-light
#FFE6A9
.{{ prefix }}-yellow-access
#FBB720
.{{ prefix }}-green-light
#B7ECCF
.{{ prefix }}-green
#05CE7C
.{{ prefix }}-green-mid
#0D6D3B
.{{ prefix }}-green-dark
#094727
.{{ prefix }}-pink-light
#F1B3bD
.{{ prefix }}-pink
#F1647C
.{{ prefix }}-red
#C6252b
.{{ prefix }}-purple
#4C2C92
.{{ prefix }}-covid-response
#803D8D
.{{ prefix }}-covid-response-light
#DAB7E0
.{{ prefix }}-grey-light
#D1D5D9
.{{ prefix }}-grey-lightest
#EEF3F7
.{{ prefix }}-grey-mid
#505C66
.{{ prefix }}-grey-dark
#172129
.{{ prefix }}-black
#000000
.{{ prefix }}-white
#FFFFFF
.{{ prefix }}-transparent
rgba(255, 255, 255, 0)
.{{ prefix }}-inherit
inherit
.{{ prefix }}-eighth-avenue
#2850AD
.{{ prefix }}-sixth-avenue
#FF6319
.{{ prefix }}-crosstown
#6CBE45
.{{ prefix }}-canarsie
#A7A9AC
.{{ prefix }}-nassau
#996633
.{{ prefix }}-broadway
#FCCC0A
.{{ prefix }}-broadway-seventh-avenue
#EE352E
.{{ prefix }}-lexington-avenue
#00933C
.{{ prefix }}-flushing
#B933AD
.{{ prefix }}-shuttles
#808183
Variants and Core Plugins
Plugin (link to docs)
Variants
Configuration
flex
[responsive]
Default
order
[responsive]
Default
width
[responsive]
Default
Installation
tailwindcss is not imported the same way as other patterns. All utilities are compiled to a Sass file which can be imported in a Sass project…
@use 'node_modules/@nycopportunity/access-patterns/dist/styles/_tailwindcss.scss';
Or a a CSS file in the /dist folder which can be included through a CDN.
<link href="https://cdn.jsdelivr.net/gh/cityofnewyork/access-nyc-patterns@v0.16.1/dist/styles/tailwindcss.css" rel="stylesheet" type="text/css">