Customizing Stacks
If you compile the Stacks within your project and need to customize some things, here are a few things you need to know.
Stacks is used on all Q&A sites in the Stack Exchange network, including Stack Overflow. Many of those sites have their own themes, e.g. with different link colors and different button styles. Large parts of Stacks are agnostic to these differences – for example, the atomic class .ps-fixed
does the same thing regardless of what site it’s used on. But some parts of Stacks need to behave differently depending on what site they’re used on – for example, the background color of the .s-btn
component differs per-site.
The parts of Stacks that are always the same across all Stack Exchange sites are called constants. The parts of Stacks that are configurable based are called configurations.
Constants are included in all network pages as a single CSS file that’s identical everywhere. Configurations, on the other hand, are compiled into the site’s primary.css
file.
Most configuration options address how varying elements or components look within a theme. However there are a few options that change constants as well. Items such as CSS reset values or responsive breakpoints can be altered.
To customize any configurable area listed below, you must include stacks.less
(or, depending on your need, stacks-dynamic.less
and/or stacks-static.less
) into your Less file and wrap your updated \configuration options within the following mixin:
To alter constants, use the following mixin:
Setting | Default | Options |
---|---|---|
@css-reset
| normalize |
normalize, meyer, none |
@breakpoints
| 1264px, 980px, 640px |
User defined |
Setting | Default |
---|---|
@bgc-lightest
| @black-050 |
@bgc-lighter
| @black-075 |
@bgc-light
| @black-100 |
@bgc-darkest
| @black-350 |
@bgc-darker
| @black-300 |
@bgc-dark
| @black-200 |
Setting | Default |
---|---|
@badge-gold
| #FFCC01 |
@badge-silver
| #B4B8BC |
@badge-bronze
| #D1A684 |
Setting | Default |
---|---|
@brc-lightest
| @black-050 |
@brc-lighter
| @black-075 |
@brc-light
| @black-100 |
@brc-darkest
| @black-350 |
@brc-darker
| @black-300 |
@brc-dark
| @black-200 |
@brc-orange
| @orange-400 |
Setting | Default |
---|---|
@br-sm
| 3px |
@br-md
| 5px |
@br-lg
| 7px |
@br-circle
| 50% |
Setting | Default |
---|---|
@bs-sm
| 0 @su2 @su8 fade(@black-700, 10%) |
@bs-md
| 0 @su4 @su8 fade(@black-700, 20%) |
@bs-lg
| 0 @su4 @su12 fade(@black-800, 20%) |
@bs-i-sm
| inset 0 @su2/2 @su8 0 fade(@black-700, 10%) |
@bs-i-md
| inset 0 @su2/2 @su8 0 fade(@black-700, 20%) |
@bs-i-lg
| inset 0 @su2/2 @su12 0 fade(@black-800, 20%) |
Setting | Default |
---|---|
@code-black
| #303336 |
@code-gray
| #858C93 |
@code-blue
| #0F74BD |
@code-maroon
| #7D2727 |
@code-purple
| #101094 |
@code-teal
| #2B91AF |
@code-red
| #E64320 |
Setting | Default |
---|---|
@fc-light
| @black-500 |
@fc-medium
| @black-700 |
@fc-dark
| @black-900 |
Setting | Default |
---|---|
@ff-sans
| Arial, "Helvetica Neue", Helvetica, sans-serif |
@ff-serif
| Georgia, Times New Roman, Times, serif |
@ff-mono
| Consolas, Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace, sans-serif |
Setting | Default |
---|---|
@fs-base
| @fs-body1 |
@fs-fine
| 11px |
@fs-caption
| 12px |
@fs-body1
| 13px |
@fs-body2
| 15px |
@fs-body3
| 17px |
@fs-subheading
| 19px |
@fs-title
| 21px |
@fs-headline1
| 27px |
@fs-headline2
| 34px |
@fs-display1
| 43px |
@fs-display2
| 55px |
@fs-display3
| 69px |
@fs-display4
| 99px |
Setting | Default |
---|---|
@lh-base
| @lh-md |
@lh-xs
| 1 |
@lh-sm
| (unit(@fs-base) + 2) / unit(@fs-base) |
@lh-md
| (unit(@fs-base) + 4) / unit(@fs-base) |
@lh-lg
| (unit(@fs-base) + 8) / unit(@fs-base) |
@lh-xl
| (unit(@fs-base) + 12) / unit(@fs-base) |
@lh-xxl
| 2 |
Setting | Default |
---|---|
@s-full
| 97.2307692rem |
@s-step
| @s-full / 12 |
@su2
| 2px |
@su4
| 4px |
@su8
| 8px |
@su12
| 12px |
@su16
| 16px |
@su24
| 24px |
@su32
| 32px |
@su48
| 48px |
@su64
| 64px |
@su96
| 96px |
@su128
| 128px |
Setting | Default |
---|---|
@te-smooth-slow
| cubic-bezier(0.25, 0.46, 0.45, 0.94) |
@te-smooth
| cubic-bezier(0.165, 0.84, 0.44, 1) |
@te-smooth-quick
| cubic-bezier(0.19, 1, 0.22, 1) |
@te-back-out
| cubic-bezier(0.175, 0.885, 0.32, 1.275) |
@te-back-slow
| cubic-bezier(0.68, -0.55, 0.265, 1.55) |
Setting | Default |
---|---|
@zi-hide
| -1 |
@zi-base
| 0 |
@zi-selected
| 25 |
@zi-active
| 30 |
@zi-dropdown
| 1000 |
@zi-popovers
| 2000 |
@zi-tooltips
| 3000 |
@zi-banners
| 4000 |
@zi-navigation
| 5000 |
@zi-navigation-fixed
| 5050 |
@zi-modals
| 9000 |
@zi-modals-background
| @zi-modals - 50 |