Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/brown-ghosts-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris-tokens': minor
---

Add 0 tokens where missing as per [the team's decision](https://github.com/Shopify/polaris/discussions/7334#discussioncomment-4988991).
5 changes: 4 additions & 1 deletion polaris-tokens/src/themes/base/border.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export type BorderRadiusAlias = 'full';

export type BorderRadiusAliasOrScale = BorderRadiusAlias | BorderRadiusScale;

export type BorderWidthScale = '0165' | '025' | '050' | '100';
export type BorderWidthScale = '0' | '0165' | '025' | '050' | '100';

export type BorderTokenName =
| `border-radius-${BorderRadiusAliasOrScale}`
Expand Down Expand Up @@ -59,6 +59,9 @@ export const border: {
'border-radius-full': {
value: '9999px',
},
'border-width-0': {
value: size['0'],
},
'border-width-0165': {
value: size['0165'],
},
Expand Down
4 changes: 4 additions & 0 deletions polaris-tokens/src/themes/base/zIndex.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type {MetaTokenProperties} from '../types';

export type ZIndexZScale =
| '0'
| '1'
| '2'
| '3'
Expand All @@ -23,6 +24,9 @@ export type ZIndexTokenGroup = {
export const zIndex: {
[TokenName in ZIndexTokenName]: MetaTokenProperties;
} = {
'z-index-0': {
value: 'auto',
Copy link
Contributor Author

@jesstelford jesstelford Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of setting 0 here, I've opted for auto which sets the value to 0 but doesn't create a new stacking context. This is to match the behaviour of shadow-0 which sets none instead of 0, and follows the principle of "Do what the user means, not what the user said".

Am happy to be challenged on this for both questions of:

  1. Do we even need a 0 zindex?
  2. Should this and shadow-0 just be 0 values?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on adding both z-index-0 and z-index-auto (similar to tailwindcss)?

},
'z-index-1': {
value: '100',
},
Expand Down