@pantheon-systems/pds-toolkit-react 2.0.0-alpha.1 → 2.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/ComparisonList/ComparisonList.d.ts +5 -1
- package/dist/components/Drawer/Drawer.d.ts +58 -0
- package/dist/components/Modal/Modal.d.ts +1 -1
- package/dist/components/SiteDashboardHeading/SiteDashboardHeading.d.ts +1 -1
- package/dist/components/StatusIndicator/StatusIndicator.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/badges/Badge/Badge.d.ts +28 -0
- package/dist/components/buttons/CloseButton/CloseButton.d.ts +6 -6
- package/dist/components/cards/Card/Card.d.ts +1 -1
- package/dist/components/cards/NewSiteCard/NewSiteCard.d.ts +1 -1
- package/dist/components/cards/PricingCard/PricingCard.d.ts +6 -1
- package/dist/components/footer/SiteFooter/SiteFooter.d.ts +5 -1
- package/dist/components/icons/Icon/Icon.d.ts +10 -730
- package/dist/components/icons/Icon/IconSearch.d.ts +1 -0
- package/dist/components/icons/Icon/custom-icons.d.ts +46 -0
- package/dist/components/icons/Icon/generated-icon-data.d.ts +1429 -0
- package/dist/components/icons/Icon/icon-registry.d.ts +34 -0
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +2 -2
- package/dist/components/inputs/ComboboxMultiselect/ComboboxMultiselect.d.ts +27 -5
- package/dist/components/inputs/Select/Select.d.ts +5 -1
- package/dist/components/inputs/Select/select-sample-data.d.ts +1 -0
- package/dist/components/inputs/TagsInput/TagsInput.d.ts +100 -0
- package/dist/components/inputs/TextInput/TextInput.d.ts +4 -0
- package/dist/components/inputs/Textarea/Textarea.d.ts +4 -0
- package/dist/components/inputs/input-utilities.d.ts +3 -3
- package/dist/components/navigation/WorkspaceSelector/WorkspaceSelector.d.ts +6 -7
- package/dist/components/notifications/Banner/Banner.d.ts +32 -12
- package/dist/components/notifications/SectionMessage/SectionMessage.d.ts +6 -2
- package/dist/components/notifications/Toaster/Toast.d.ts +1 -1
- package/dist/components/notifications/Toaster/Toaster.d.ts +2 -2
- package/dist/components/panels/ExpansionPanel/ExpansionPanel.d.ts +5 -1
- package/dist/components/panels/Panel/Panel.d.ts +1 -18
- package/dist/css/component-css/pds-avatar.css +1 -1
- package/dist/css/component-css/pds-badge.css +1 -0
- package/dist/css/component-css/pds-banner.css +1 -1
- package/dist/css/component-css/pds-breadcrumb.css +1 -1
- package/dist/css/component-css/pds-button-link.css +1 -1
- package/dist/css/component-css/pds-button-nav.css +1 -1
- package/dist/css/component-css/pds-button.css +9 -3
- package/dist/css/component-css/pds-callout.css +1 -1
- package/dist/css/component-css/pds-card-select-group.css +1 -1
- package/dist/css/component-css/pds-card.css +1 -1
- package/dist/css/component-css/pds-checkbox.css +1 -1
- package/dist/css/component-css/pds-close-button.css +1 -1
- package/dist/css/component-css/pds-combobox-multiselect.css +2 -2
- package/dist/css/component-css/pds-compact-empty-state.css +1 -1
- package/dist/css/component-css/pds-comparison-list.css +1 -1
- package/dist/css/component-css/pds-cta-link.css +1 -1
- package/dist/css/component-css/pds-dashboard-nav.css +2 -2
- package/dist/css/component-css/pds-datepicker.css +1 -1
- package/dist/css/component-css/pds-drawer.css +1 -0
- package/dist/css/component-css/pds-expansion-panel.css +1 -1
- package/dist/css/component-css/pds-file-upload.css +2 -2
- package/dist/css/component-css/pds-flow-steps.css +1 -1
- package/dist/css/component-css/pds-footer-links.css +1 -1
- package/dist/css/component-css/pds-horizontal-empty-state.css +1 -1
- package/dist/css/component-css/pds-icon-button.css +4 -4
- package/dist/css/component-css/pds-icon-story-only.css +1 -1
- package/dist/css/component-css/pds-icon.css +1 -0
- package/dist/css/component-css/pds-index.css +29 -45
- package/dist/css/component-css/pds-inline-message.css +1 -1
- package/dist/css/component-css/pds-input-utilities.css +1 -1
- package/dist/css/component-css/pds-menu-button.css +1 -1
- package/dist/css/component-css/pds-modal.css +1 -1
- package/dist/css/component-css/pds-pagination.css +1 -1
- package/dist/css/component-css/pds-panel.css +1 -1
- package/dist/css/component-css/pds-pantheon-logo.css +1 -1
- package/dist/css/component-css/pds-pricing-card.css +1 -1
- package/dist/css/component-css/pds-progress-bar.css +1 -1
- package/dist/css/component-css/pds-pull-quote.css +1 -1
- package/dist/css/component-css/pds-radio-group.css +1 -1
- package/dist/css/component-css/pds-refresh-checker.css +1 -1
- package/dist/css/component-css/pds-section-message.css +1 -1
- package/dist/css/component-css/pds-segmented-button.css +1 -1
- package/dist/css/component-css/pds-select.css +1 -1
- package/dist/css/component-css/pds-side-nav-compact.css +1 -1
- package/dist/css/component-css/pds-side-nav-global.css +7 -5
- package/dist/css/component-css/pds-side-nav.css +1 -1
- package/dist/css/component-css/pds-site-footer.css +1 -1
- package/dist/css/component-css/pds-skiplink.css +1 -1
- package/dist/css/component-css/pds-spinner.css +1 -1
- package/dist/css/component-css/pds-sso-button.css +1 -1
- package/dist/css/component-css/pds-status-badge.css +1 -1
- package/dist/css/component-css/pds-status-indicator.css +1 -1
- package/dist/css/component-css/pds-stepper.css +1 -1
- package/dist/css/component-css/pds-tab-menu.css +1 -1
- package/dist/css/component-css/pds-table-of-contents.css +1 -1
- package/dist/css/component-css/pds-tabs.css +1 -1
- package/dist/css/component-css/pds-tag.css +1 -1
- package/dist/css/component-css/pds-tags-input.css +1 -0
- package/dist/css/component-css/pds-text-input.css +1 -1
- package/dist/css/component-css/pds-textarea.css +1 -1
- package/dist/css/component-css/pds-toaster.css +1 -1
- package/dist/css/component-css/pds-tooltip.css +1 -1
- package/dist/css/component-css/pds-vertical-empty-state.css +1 -1
- package/dist/css/component-css/pds-workspace-selector.css +1 -1
- package/dist/css/design-tokens/fonts.css +1 -1
- package/dist/css/design-tokens/variables.dark.css +155 -28
- package/dist/css/design-tokens/variables.global.css +4 -3
- package/dist/css/design-tokens/variables.light.css +130 -25
- package/dist/css/design-tokens/variables.typography.css +8 -5
- package/dist/css/layout-css/pds-app-layout.css +2 -0
- package/dist/css/layout-css/pds-dashboard-global.css +8 -0
- package/dist/css/layout-css/pds-dashboard-inner.css +1 -0
- package/dist/css/layout-css/pds-docs-layout.css +1 -0
- package/dist/css/layout-css/pds-flex-container.css +1 -0
- package/dist/css/layout-css/pds-index.css +9 -0
- package/dist/css/layout-css/pds-stepper-layout.css +1 -0
- package/dist/css/layout-css/pds-three-item-layout.css +1 -0
- package/dist/css/layout-css/pds-two-item-layout.css +1 -0
- package/dist/css/pds-components.css +29 -45
- package/dist/css/pds-core.css +2 -2
- package/dist/css/pds-layouts.css +2 -2
- package/dist/index.css +1 -1
- package/dist/index.d.ts +33 -0
- package/dist/index.js +5394 -1636
- package/dist/index.js.map +1 -1
- package/dist/index.source.d.ts +3 -1
- package/dist/layouts/AppLayout/AppLayout.d.ts +15 -6
- package/dist/libs/types/custom-types.d.ts +2 -2
- package/dist/svg/angleDown.svg +3 -0
- package/dist/svg/angleLeft.svg +3 -0
- package/dist/svg/angleRight.svg +3 -0
- package/dist/svg/angleUp.svg +3 -0
- package/dist/svg/anglesLeft.svg +3 -0
- package/dist/svg/anglesRight.svg +3 -0
- package/dist/svg/arrowDownToLine.svg +3 -0
- package/dist/svg/arrowLeft.svg +3 -0
- package/dist/svg/arrowRight.svg +3 -0
- package/dist/svg/arrowsRetweet.svg +3 -0
- package/dist/svg/asterisk.svg +3 -0
- package/dist/svg/banBug.svg +3 -0
- package/dist/svg/bars.svg +3 -0
- package/dist/svg/barsFilter.svg +3 -0
- package/dist/svg/bell.svg +3 -0
- package/dist/svg/billboard.svg +3 -0
- package/dist/svg/bitbucket.svg +3 -0
- package/dist/svg/bluesky.svg +3 -0
- package/dist/svg/bolt.svg +3 -0
- package/dist/svg/boltPantheon.svg +3 -0
- package/dist/svg/boltSolid.svg +3 -0
- package/dist/svg/book.svg +3 -0
- package/dist/svg/books.svg +3 -0
- package/dist/svg/bracketRight.svg +3 -0
- package/dist/svg/bracketsSquare.svg +3 -0
- package/dist/svg/brainCircuit.svg +3 -0
- package/dist/svg/broomWide.svg +3 -0
- package/dist/svg/building.svg +3 -0
- package/dist/svg/buildings.svg +3 -0
- package/dist/svg/bullhorn.svg +3 -0
- package/dist/svg/calendarDays.svg +3 -0
- package/dist/svg/caretDown.svg +3 -0
- package/dist/svg/caretLeft.svg +3 -0
- package/dist/svg/caretRight.svg +3 -0
- package/dist/svg/caretUp.svg +3 -0
- package/dist/svg/ccAmex.svg +3 -0
- package/dist/svg/ccApplePay.svg +3 -0
- package/dist/svg/ccDiscover.svg +3 -0
- package/dist/svg/ccGeneric.svg +3 -0
- package/dist/svg/ccMC.svg +3 -0
- package/dist/svg/ccPaypal.svg +3 -0
- package/dist/svg/ccVisa.svg +3 -0
- package/dist/svg/chartLine.svg +3 -0
- package/dist/svg/chartNetwork.svg +3 -0
- package/dist/svg/chartSimple.svg +3 -0
- package/dist/svg/check.svg +3 -0
- package/dist/svg/circle.svg +3 -0
- package/dist/svg/circleCheck.svg +3 -0
- package/dist/svg/circleExclamation.svg +3 -0
- package/dist/svg/circleInfo.svg +3 -0
- package/dist/svg/circleMinus.svg +3 -0
- package/dist/svg/circleNotch.svg +3 -0
- package/dist/svg/circlePlus.svg +3 -0
- package/dist/svg/circleQuestion.svg +3 -0
- package/dist/svg/circleUser.svg +3 -0
- package/dist/svg/circleXmark.svg +3 -0
- package/dist/svg/cloud.svg +3 -0
- package/dist/svg/cloudArrowDown.svg +3 -0
- package/dist/svg/cloudArrowUp.svg +3 -0
- package/dist/svg/cloudPlus.svg +3 -0
- package/dist/svg/code.svg +3 -0
- package/dist/svg/codeBranch.svg +3 -0
- package/dist/svg/codeMerge.svg +3 -0
- package/dist/svg/command.svg +3 -0
- package/dist/svg/comment.svg +3 -0
- package/dist/svg/copy.svg +3 -0
- package/dist/svg/desktop.svg +3 -0
- package/dist/svg/diamondExclamation.svg +3 -0
- package/dist/svg/diamonds4.svg +3 -0
- package/dist/svg/discourse.svg +3 -0
- package/dist/svg/display.svg +3 -0
- package/dist/svg/dollarSign.svg +3 -0
- package/dist/svg/download.svg +3 -0
- package/dist/svg/drupal.svg +3 -0
- package/dist/svg/ellipsis.svg +3 -0
- package/dist/svg/ellipsisVertical.svg +3 -0
- package/dist/svg/emptySet.svg +3 -0
- package/dist/svg/envelope.svg +3 -0
- package/dist/svg/envelopeOpen.svg +3 -0
- package/dist/svg/exclamation.svg +3 -0
- package/dist/svg/expand.svg +3 -0
- package/dist/svg/expandFromCenter.svg +3 -0
- package/dist/svg/externalLink.svg +3 -0
- package/dist/svg/eye.svg +3 -0
- package/dist/svg/eyeSlash.svg +3 -0
- package/dist/svg/facebook.svg +3 -0
- package/dist/svg/file.svg +3 -0
- package/dist/svg/fileCSV.svg +3 -0
- package/dist/svg/fileCheck.svg +3 -0
- package/dist/svg/fileContract.svg +3 -0
- package/dist/svg/fileDiff.svg +3 -0
- package/dist/svg/fileExport.svg +3 -0
- package/dist/svg/fileImport.svg +3 -0
- package/dist/svg/fileLines.svg +3 -0
- package/dist/svg/filePDF.svg +3 -0
- package/dist/svg/fileZip.svg +3 -0
- package/dist/svg/folder.svg +3 -0
- package/dist/svg/folderTree.svg +3 -0
- package/dist/svg/gear.svg +3 -0
- package/dist/svg/gem.svg +3 -0
- package/dist/svg/github.svg +3 -0
- package/dist/svg/gitlab.svg +3 -0
- package/dist/svg/globe.svg +3 -0
- package/dist/svg/graduationCap.svg +3 -0
- package/dist/svg/grid.svg +3 -0
- package/dist/svg/gripDots.svg +3 -0
- package/dist/svg/gripDotsVertical.svg +3 -0
- package/dist/svg/heart.svg +3 -0
- package/dist/svg/heartSolid.svg +3 -0
- package/dist/svg/house.svg +3 -0
- package/dist/svg/idCard.svg +3 -0
- package/dist/svg/image.svg +3 -0
- package/dist/svg/inputText.svg +3 -0
- package/dist/svg/instagram.svg +3 -0
- package/dist/svg/keySkeleton.svg +3 -0
- package/dist/svg/laptop.svg +3 -0
- package/dist/svg/laptopCode.svg +3 -0
- package/dist/svg/leaf.svg +3 -0
- package/dist/svg/lifeRing.svg +3 -0
- package/dist/svg/linkSimple.svg +3 -0
- package/dist/svg/linkSimpleSlash.svg +3 -0
- package/dist/svg/linkedin.svg +3 -0
- package/dist/svg/listCheck.svg +3 -0
- package/dist/svg/locationCrosshairs.svg +3 -0
- package/dist/svg/lock.svg +3 -0
- package/dist/svg/lockOpen.svg +3 -0
- package/dist/svg/magnifyingGlass.svg +3 -0
- package/dist/svg/medal.svg +3 -0
- package/dist/svg/memo.svg +3 -0
- package/dist/svg/messages.svg +3 -0
- package/dist/svg/minus.svg +3 -0
- package/dist/svg/moon.svg +3 -0
- package/dist/svg/nextJs.svg +3 -0
- package/dist/svg/paperPlane.svg +3 -0
- package/dist/svg/paperclip.svg +3 -0
- package/dist/svg/pen.svg +3 -0
- package/dist/svg/penField.svg +3 -0
- package/dist/svg/phone.svg +3 -0
- package/dist/svg/play.svg +3 -0
- package/dist/svg/plus.svg +3 -0
- package/dist/svg/question.svg +3 -0
- package/dist/svg/quotesLeft.svg +3 -0
- package/dist/svg/quotesRight.svg +3 -0
- package/dist/svg/rectangleList.svg +3 -0
- package/dist/svg/reply.svg +3 -0
- package/dist/svg/robot.svg +3 -0
- package/dist/svg/rocketLaunch.svg +3 -0
- package/dist/svg/rotate.svg +3 -0
- package/dist/svg/rotateClock.svg +3 -0
- package/dist/svg/rotateLeft.svg +3 -0
- package/dist/svg/rotateRight.svg +3 -0
- package/dist/svg/rss.svg +3 -0
- package/dist/svg/save.svg +3 -0
- package/dist/svg/server.svg +3 -0
- package/dist/svg/shareNodes.svg +3 -0
- package/dist/svg/shield.svg +3 -0
- package/dist/svg/shieldQuartered.svg +3 -0
- package/dist/svg/shovel.svg +3 -0
- package/dist/svg/siren.svg +3 -0
- package/dist/svg/sirenOn.svg +3 -0
- package/dist/svg/sitemap.svg +3 -0
- package/dist/svg/slack.svg +3 -0
- package/dist/svg/slashForward.svg +3 -0
- package/dist/svg/slidersSimple.svg +3 -0
- package/dist/svg/snowflake.svg +3 -0
- package/dist/svg/sparkles.svg +3 -0
- package/dist/svg/squareCheck.svg +3 -0
- package/dist/svg/squareCode.svg +3 -0
- package/dist/svg/squareMinus.svg +3 -0
- package/dist/svg/squarePen.svg +3 -0
- package/dist/svg/squareQuestion.svg +3 -0
- package/dist/svg/squareTerminal.svg +3 -0
- package/dist/svg/star.svg +3 -0
- package/dist/svg/starSolid.svg +3 -0
- package/dist/svg/sun.svg +3 -0
- package/dist/svg/sunBright.svg +3 -0
- package/dist/svg/table.svg +3 -0
- package/dist/svg/tableRows.svg +3 -0
- package/dist/svg/terminal.svg +3 -0
- package/dist/svg/text.svg +3 -0
- package/dist/svg/threads.svg +3 -0
- package/dist/svg/thumbsDown.svg +3 -0
- package/dist/svg/thumbsUp.svg +3 -0
- package/dist/svg/trash.svg +3 -0
- package/dist/svg/triangleExclamation.svg +3 -0
- package/dist/svg/twitter.svg +3 -0
- package/dist/svg/upload.svg +3 -0
- package/dist/svg/user.svg +3 -0
- package/dist/svg/userAstronaut.svg +3 -0
- package/dist/svg/userGear.svg +3 -0
- package/dist/svg/userPlus.svg +3 -0
- package/dist/svg/users.svg +3 -0
- package/dist/svg/video.svg +3 -0
- package/dist/svg/wavePulse.svg +3 -0
- package/dist/svg/windowRestore.svg +3 -0
- package/dist/svg/wordpress.svg +3 -0
- package/dist/svg/wreathLaurel.svg +3 -0
- package/dist/svg/wrench.svg +3 -0
- package/dist/svg/xTwitter.svg +3 -0
- package/dist/svg/xmark.svg +3 -0
- package/dist/svg/xmarkLarge.svg +3 -0
- package/dist/svg/youtube.svg +3 -0
- package/package.json +38 -22
- package/tailwind/README.md +220 -0
- package/tailwind/TESTING.md +457 -0
- package/tailwind/v3/preset.cjs +258 -0
- package/tailwind/v4/theme.css +230 -0
- package/dist/components/badges/IndicatorBadge/IndicatorBadge.d.ts +0 -27
- package/dist/css/component-css/pds-indicator-badge.css +0 -25
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
# PDS Tailwind Configuration
|
|
2
|
+
|
|
3
|
+
Tailwind CSS configs that map Pantheon Design System tokens to Tailwind utilities. Available for both Tailwind v3 and v4.
|
|
4
|
+
|
|
5
|
+
> **Note:** Using Tailwind CSS alongside PDS is not the recommended approach. PDS components handle their own styling. This configuration is provided so that UI built outside the scope of PDS components uses correct design system values rather than arbitrary ones.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Both configs require `pds-core.css` to be loaded globally in your app. This provides the `--pds-*` CSS custom properties that the Tailwind utilities reference at runtime.
|
|
12
|
+
|
|
13
|
+
Import it as a JavaScript import in your app's root layout — this ensures reliable module resolution via the package `exports` map:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
> **Note:** Use `css/pds-core.css`, not `dist/css/pds-core.css`. The package exports map handles the `dist/` prefix automatically. Using a CSS `@import` instead of a JS import can cause resolution failures in some bundlers (including Next.js with Turbopack).
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Tailwind v4
|
|
24
|
+
|
|
25
|
+
**Recommended for new projects.**
|
|
26
|
+
|
|
27
|
+
### Setup
|
|
28
|
+
|
|
29
|
+
In `app/layout.tsx` (or your root layout):
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
33
|
+
import './globals.css';
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
In `app/globals.css`:
|
|
37
|
+
|
|
38
|
+
```css
|
|
39
|
+
/* Tailwind layers — imported separately to exclude preflight */
|
|
40
|
+
@import 'tailwindcss/theme' layer(theme);
|
|
41
|
+
@import 'tailwindcss/utilities' layer(utilities);
|
|
42
|
+
|
|
43
|
+
/* PDS theme overrides */
|
|
44
|
+
@import '@pantheon-systems/pds-toolkit-react/tailwind/v4/theme.css';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> **Why not `@import "tailwindcss"`?**
|
|
48
|
+
> The single `@import "tailwindcss"` shorthand includes Tailwind's preflight CSS reset, which conflicts with PDS base styles. Importing the layers individually lets you skip preflight.
|
|
49
|
+
|
|
50
|
+
No `tailwind.config.js` is needed.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Tailwind v3
|
|
55
|
+
|
|
56
|
+
### Setup
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npm install tailwindcss@3
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`tailwind.config.js`:
|
|
63
|
+
|
|
64
|
+
```js
|
|
65
|
+
/** @type {import('tailwindcss').Config} */
|
|
66
|
+
module.exports = {
|
|
67
|
+
presets: [require('@pantheon-systems/pds-toolkit-react/tailwind/v3/preset')],
|
|
68
|
+
content: ['./src/**/*.{js,ts,jsx,tsx}'],
|
|
69
|
+
};
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
In `app/layout.tsx` (or your root layout):
|
|
73
|
+
|
|
74
|
+
```ts
|
|
75
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
76
|
+
import './globals.css';
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`app/globals.css`:
|
|
80
|
+
|
|
81
|
+
```css
|
|
82
|
+
/* Tailwind directives */
|
|
83
|
+
@tailwind base;
|
|
84
|
+
@tailwind components;
|
|
85
|
+
@tailwind utilities;
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Preflight is disabled automatically by the preset.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## What's included
|
|
93
|
+
|
|
94
|
+
### Colors
|
|
95
|
+
|
|
96
|
+
All values reference PDS CSS custom properties — dark mode works automatically.
|
|
97
|
+
|
|
98
|
+
| Group | Example utility | PDS token |
|
|
99
|
+
| ------------------- | ------------------------------ | --------------------------------------- |
|
|
100
|
+
| `bg-*` | `bg-bg-default` | `--pds-color-bg-default` |
|
|
101
|
+
| `fg-*` | `text-fg-default` | `--pds-color-fg-default` |
|
|
102
|
+
| `text-*` | `text-text-secondary` | `--pds-color-text-default-secondary` |
|
|
103
|
+
| `border-*` | `border-border-input` | `--pds-color-border-input` |
|
|
104
|
+
| `interactive-*` | `text-interactive-link` | `--pds-color-interactive-link-default` |
|
|
105
|
+
| `status-{type}-*` | `bg-status-success-background` | `--pds-color-status-success-background` |
|
|
106
|
+
| `brand-primary-*` | `bg-brand-primary-400` | `--pds-color-brand-primary-400` |
|
|
107
|
+
| `brand-secondary-*` | `bg-brand-secondary` | `--pds-color-brand-secondary-default` |
|
|
108
|
+
| `brand-accent-*` | `text-brand-accent` | `--pds-color-brand-accent-default` |
|
|
109
|
+
|
|
110
|
+
### Spacing
|
|
111
|
+
|
|
112
|
+
The PDS named scale replaces Tailwind's default numeric scale. Use semantic keys like `p-m`, `gap-xl`, `mt-2xl`.
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<div class="p-m gap-xl mt-2xl">...</div>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Common Tailwind numeric values are also aliased to their nearest PDS equivalent, so `p-4` still works and stays in sync with the token:
|
|
119
|
+
|
|
120
|
+
| Tailwind | PDS key | Value |
|
|
121
|
+
| -------- | ------- | ------- |
|
|
122
|
+
| `p-1` | `p-4xs` | 0.25rem |
|
|
123
|
+
| `p-2` | `p-2xs` | 0.5rem |
|
|
124
|
+
| `p-3` | `p-s` | 0.75rem |
|
|
125
|
+
| `p-4` | `p-m` | 1rem |
|
|
126
|
+
| `p-5` | `p-l` | 1.25rem |
|
|
127
|
+
| `p-6` | `p-xl` | 1.5rem |
|
|
128
|
+
| `p-8` | `p-2xl` | 2rem |
|
|
129
|
+
| `p-10` | `p-3xl` | 2.5rem |
|
|
130
|
+
| `p-12` | `p-4xl` | 3rem |
|
|
131
|
+
| `p-16` | `p-5xl` | 4rem |
|
|
132
|
+
|
|
133
|
+
Values like `p-7`, `p-9`, `p-11` (which don't have a clean PDS equivalent) are not aliased and will not generate any CSS.
|
|
134
|
+
|
|
135
|
+
> **Numeric aliases use CSS variable references**, not hardcoded values. If a PDS spacing token ever changes, `p-4` will automatically reflect the new value — no config update needed.
|
|
136
|
+
|
|
137
|
+
### Typography
|
|
138
|
+
|
|
139
|
+
```html
|
|
140
|
+
<p class="font-sans text-m font-normal leading-m">Body text</p>
|
|
141
|
+
<h2 class="font-sans text-2xl font-semibold leading-s">Heading</h2>
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
| Scale | Font size | Font family | Font weight | Line height | Letter spacing |
|
|
145
|
+
| ----- | ------------ | ----------------------- | ----------------------------------------------- | ------------------- | ------------------- |
|
|
146
|
+
| Keys | `xs` – `9xl` | `sans`, `serif`, `mono` | `light`, `normal`, `medium`, `semibold`, `bold` | `s`, `m`, `l`, `xl` | `s`, `m`, `l`, `xl` |
|
|
147
|
+
|
|
148
|
+
### Border radius
|
|
149
|
+
|
|
150
|
+
```html
|
|
151
|
+
<div class="rounded-container">Card</div>
|
|
152
|
+
<button class="rounded-button">Button</button>
|
|
153
|
+
<input class="rounded-input" />
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Keys: `none`, `DEFAULT` (`rounded`), `button`, `input`, `container`, `bar`, `full`
|
|
157
|
+
|
|
158
|
+
### Z-index
|
|
159
|
+
|
|
160
|
+
```html
|
|
161
|
+
<div class="z-modal">Modal</div>
|
|
162
|
+
<nav class="z-navigation">Nav</nav>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Keys: `navigation`, `dropdown`, `notifications`, `overlay`, `modal`, `max`
|
|
166
|
+
|
|
167
|
+
### Max width
|
|
168
|
+
|
|
169
|
+
Matches PDS `Container` component breakpoints. Use when building layout sections outside PDS container components.
|
|
170
|
+
|
|
171
|
+
```html
|
|
172
|
+
<div class="max-w-standard mx-auto px-m">...</div>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Keys: `narrow` (1024px), `standard` (1200px), `wide` (1440px), `x-wide` (1600px)
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Important caveats
|
|
180
|
+
|
|
181
|
+
### Borders require an explicit border-style
|
|
182
|
+
|
|
183
|
+
The PDS preset resets `border-style` to `none` on all elements so that borders are fully opt-in. This prevents phantom borders on elements that pick up a non-zero `border-width` from PDS components, inheritance, or browser defaults. When adding borders with Tailwind, always include a border-style class (`border-solid`, `border-dashed`, or `border-dotted`):
|
|
184
|
+
|
|
185
|
+
```html
|
|
186
|
+
<div class="border border-solid border-border-default">...</div>
|
|
187
|
+
<div class="border-b border-solid border-border-separator">Divider</div>
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### Opacity modifiers are not supported
|
|
191
|
+
|
|
192
|
+
Tailwind's opacity modifier syntax (`bg-bg-default/50`) does not work with CSS variable color references. This is a known Tailwind limitation — the compiler cannot decompose a CSS variable into RGB channels. Avoid using opacity modifiers with PDS colors.
|
|
193
|
+
|
|
194
|
+
### Apply Tailwind utilities to your own elements, not PDS components
|
|
195
|
+
|
|
196
|
+
PDS components are styled with scoped BEM classes. Do not use Tailwind utilities to override PDS component styles — use component props and the `className` prop for layout adjustments only. Applying Tailwind utility classes to PDS component internals will lead to unpredictable results.
|
|
197
|
+
|
|
198
|
+
```jsx
|
|
199
|
+
// ✅ Tailwind for your layout, PDS for the component
|
|
200
|
+
<div class="flex gap-m items-center">
|
|
201
|
+
<Button label="Save" variant="primary" />
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
// ❌ Don't override PDS component internals with Tailwind
|
|
205
|
+
<Button label="Save" className="text-red-500 bg-blue-200" />
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Import order matters
|
|
209
|
+
|
|
210
|
+
`pds-core.css` must be imported before Tailwind. If Tailwind's utilities load before PDS variables are defined, the CSS custom property references will resolve to empty values.
|
|
211
|
+
|
|
212
|
+
### Scanning for class names (`@source` in v4)
|
|
213
|
+
|
|
214
|
+
Tailwind v4 automatically scans your project files for class names. If your source files are outside the default scan path (common in monorepos), add a `@source` directive to your CSS entry point:
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
@source './src/**/*.{js,ts,jsx,tsx}';
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
This is your project's responsibility — the PDS package does not need to be scanned (PDS components do not use Tailwind class names internally).
|
|
@@ -0,0 +1,457 @@
|
|
|
1
|
+
# Tailwind Configuration — Testing Plan
|
|
2
|
+
|
|
3
|
+
Test the v3 preset and v4 theme against real Next.js projects before shipping.
|
|
4
|
+
Create one project per Tailwind version.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Setup: Install PDS Locally
|
|
9
|
+
|
|
10
|
+
Before creating test projects, pack the local PDS package into a tarball.
|
|
11
|
+
This is more reliable than `npm link` and tests exactly what would be published.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# In the pds-toolkit-react repo root — run build:lib first so dist/ exists
|
|
15
|
+
npm run build:lib
|
|
16
|
+
|
|
17
|
+
# Pack into a tarball (creates e.g. pantheon-systems-pds-toolkit-react-2.0.0-alpha.7.tgz)
|
|
18
|
+
npm pack
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
You'll reference this tarball when installing into each test project.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Project A — Tailwind v3
|
|
26
|
+
|
|
27
|
+
### 1. Create the project
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx create-next-app@latest pds-tw-test-v3 \
|
|
31
|
+
--typescript --no-tailwind --no-eslint --no-src-dir --app
|
|
32
|
+
cd pds-tw-test-v3
|
|
33
|
+
npm install tailwindcss@3 postcss autoprefixer
|
|
34
|
+
npx tailwindcss init -p
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 2. Install PDS locally
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install /path/to/pds-toolkit-react/pantheon-systems-pds-toolkit-react-*.tgz
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 3. Configure Tailwind
|
|
44
|
+
|
|
45
|
+
Replace `tailwind.config.js` contents:
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
/** @type {import('tailwindcss').Config} */
|
|
49
|
+
module.exports = {
|
|
50
|
+
presets: [require('@pantheon-systems/pds-toolkit-react/tailwind/v3/preset')],
|
|
51
|
+
content: ['./app/**/*.{js,ts,jsx,tsx}'],
|
|
52
|
+
};
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 4. Configure global CSS
|
|
56
|
+
|
|
57
|
+
Add to the top of `app/layout.tsx` (before `./globals.css`):
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
61
|
+
import './globals.css';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Replace `app/globals.css` contents:
|
|
65
|
+
|
|
66
|
+
```css
|
|
67
|
+
@tailwind base;
|
|
68
|
+
@tailwind components;
|
|
69
|
+
@tailwind utilities;
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> **Note:** Import pds-core.css as a JS import in layout.tsx rather than a CSS
|
|
73
|
+
> `@import` in globals.css. Next.js module resolution handles package `exports`
|
|
74
|
+
> maps correctly for JS imports; CSS `@import` resolution is less reliable.
|
|
75
|
+
> The path is `css/pds-core.css` (not `dist/css/`) — the package exports map
|
|
76
|
+
> handles the `dist/` prefix automatically.
|
|
77
|
+
|
|
78
|
+
### 5. Run the project
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
npm run dev
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Project B — Tailwind v4
|
|
87
|
+
|
|
88
|
+
### 1. Create the project
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
npx create-next-app@latest pds-tw-test-v4 \
|
|
92
|
+
--typescript --no-tailwind --no-eslint --no-src-dir --app
|
|
93
|
+
cd pds-tw-test-v4
|
|
94
|
+
npm install tailwindcss@latest
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### 2. Install PDS locally
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm install /path/to/pds-toolkit-react/pantheon-systems-pds-toolkit-react-*.tgz
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 3. Configure global CSS
|
|
104
|
+
|
|
105
|
+
Add to the top of `app/layout.tsx` (before `./globals.css`):
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import '@pantheon-systems/pds-toolkit-react/css/pds-core.css';
|
|
109
|
+
import './globals.css';
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Replace `app/globals.css` contents:
|
|
113
|
+
|
|
114
|
+
```css
|
|
115
|
+
@import 'tailwindcss/theme' layer(theme);
|
|
116
|
+
@import 'tailwindcss/utilities' layer(utilities);
|
|
117
|
+
|
|
118
|
+
@import '@pantheon-systems/pds-toolkit-react/tailwind/v4/theme.css';
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
No `tailwind.config.js` needed.
|
|
122
|
+
|
|
123
|
+
### 4. Run the project
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run dev
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Test Page
|
|
132
|
+
|
|
133
|
+
Replace `app/page.tsx` in both projects with the following. It exercises every
|
|
134
|
+
token category and gives you a single visual reference to review.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
export default function Page() {
|
|
138
|
+
return (
|
|
139
|
+
<div className='p-xl font-sans'>
|
|
140
|
+
<h1 className='text-2xl font-semibold leading-s tracking-s mb-xl text-text-default'>
|
|
141
|
+
PDS Tailwind Test Page
|
|
142
|
+
</h1>
|
|
143
|
+
|
|
144
|
+
{/* ── Colors ──────────────────────────────────────────────── */}
|
|
145
|
+
<section className='mb-2xl'>
|
|
146
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>Colors</h2>
|
|
147
|
+
|
|
148
|
+
<div className='flex gap-m flex-wrap mb-m'>
|
|
149
|
+
<div className='p-m rounded-container bg-bg-default border border-border-default'>
|
|
150
|
+
<span className='text-text-default text-s'>bg-default</span>
|
|
151
|
+
</div>
|
|
152
|
+
<div className='p-m rounded-container bg-bg-secondary border border-border-default'>
|
|
153
|
+
<span className='text-text-default text-s'>bg-secondary</span>
|
|
154
|
+
</div>
|
|
155
|
+
<div className='p-m rounded-container bg-bg-reverse'>
|
|
156
|
+
<span className='text-text-reverse text-s'>bg-reverse</span>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div className='flex gap-m flex-wrap mb-m'>
|
|
161
|
+
<div className='p-m rounded-container bg-status-info-background'>
|
|
162
|
+
<span className='text-status-info-foreground text-s'>info</span>
|
|
163
|
+
</div>
|
|
164
|
+
<div className='p-m rounded-container bg-status-success-background'>
|
|
165
|
+
<span className='text-status-success-foreground text-s'>
|
|
166
|
+
success
|
|
167
|
+
</span>
|
|
168
|
+
</div>
|
|
169
|
+
<div className='p-m rounded-container bg-status-warning-background'>
|
|
170
|
+
<span className='text-status-warning-foreground text-s'>
|
|
171
|
+
warning
|
|
172
|
+
</span>
|
|
173
|
+
</div>
|
|
174
|
+
<div className='p-m rounded-container bg-status-critical-background'>
|
|
175
|
+
<span className='text-status-critical-foreground text-s'>
|
|
176
|
+
critical
|
|
177
|
+
</span>
|
|
178
|
+
</div>
|
|
179
|
+
<div className='p-m rounded-container bg-status-discovery-background'>
|
|
180
|
+
<span className='text-status-discovery-foreground text-s'>
|
|
181
|
+
discovery
|
|
182
|
+
</span>
|
|
183
|
+
</div>
|
|
184
|
+
</div>
|
|
185
|
+
|
|
186
|
+
<div className='flex gap-m flex-wrap'>
|
|
187
|
+
<div className='p-m rounded-container bg-brand-primary'>
|
|
188
|
+
<span className='text-white text-s'>brand-primary</span>
|
|
189
|
+
</div>
|
|
190
|
+
<div className='p-m rounded-container bg-brand-primary-200'>
|
|
191
|
+
<span className='text-text-default text-s'>brand-primary-200</span>
|
|
192
|
+
</div>
|
|
193
|
+
<div className='p-m rounded-container bg-brand-secondary'>
|
|
194
|
+
<span className='text-text-default text-s'>brand-secondary</span>
|
|
195
|
+
</div>
|
|
196
|
+
<div className='p-m rounded-container bg-brand-accent'>
|
|
197
|
+
<span className='text-white text-s'>brand-accent</span>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
</section>
|
|
201
|
+
|
|
202
|
+
{/* ── Interactive / Links ──────────────────────────────────── */}
|
|
203
|
+
<section className='mb-2xl'>
|
|
204
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>
|
|
205
|
+
Interactive
|
|
206
|
+
</h2>
|
|
207
|
+
<a
|
|
208
|
+
href='#'
|
|
209
|
+
className='text-interactive-link hover:text-interactive-link-hover text-m'
|
|
210
|
+
>
|
|
211
|
+
Interactive link
|
|
212
|
+
</a>
|
|
213
|
+
</section>
|
|
214
|
+
|
|
215
|
+
{/* ── Spacing ─────────────────────────────────────────────── */}
|
|
216
|
+
<section className='mb-2xl'>
|
|
217
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>Spacing</h2>
|
|
218
|
+
<div className='flex gap-xs items-end'>
|
|
219
|
+
{[
|
|
220
|
+
'6xs',
|
|
221
|
+
'5xs',
|
|
222
|
+
'4xs',
|
|
223
|
+
'3xs',
|
|
224
|
+
'2xs',
|
|
225
|
+
'xs',
|
|
226
|
+
's',
|
|
227
|
+
'm',
|
|
228
|
+
'l',
|
|
229
|
+
'xl',
|
|
230
|
+
'2xl',
|
|
231
|
+
].map((size) => (
|
|
232
|
+
<div
|
|
233
|
+
key={size}
|
|
234
|
+
className={`bg-brand-primary-200 w-m`}
|
|
235
|
+
style={{ height: `var(--pds-spacing-${size})` }}
|
|
236
|
+
/>
|
|
237
|
+
))}
|
|
238
|
+
</div>
|
|
239
|
+
<p className='text-s text-text-secondary mt-s'>
|
|
240
|
+
Spacing scale 6xs → 2xl (heights driven by CSS vars, gap uses Tailwind
|
|
241
|
+
spacing)
|
|
242
|
+
</p>
|
|
243
|
+
</section>
|
|
244
|
+
|
|
245
|
+
{/* ── Typography ──────────────────────────────────────────── */}
|
|
246
|
+
<section className='mb-2xl'>
|
|
247
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>
|
|
248
|
+
Typography
|
|
249
|
+
</h2>
|
|
250
|
+
<p className='font-sans text-xs mb-xs text-text-default'>
|
|
251
|
+
font-sans / text-xs — Inter
|
|
252
|
+
</p>
|
|
253
|
+
<p className='font-sans text-m mb-xs text-text-default'>
|
|
254
|
+
font-sans / text-m
|
|
255
|
+
</p>
|
|
256
|
+
<p className='font-sans text-xl font-semibold mb-xs text-text-default'>
|
|
257
|
+
font-sans / text-xl / font-semibold
|
|
258
|
+
</p>
|
|
259
|
+
<p className='font-compact text-xl mb-xs text-text-default'>
|
|
260
|
+
font-compact / text-xl — Inter Tight
|
|
261
|
+
</p>
|
|
262
|
+
<p className='font-serif text-xl mb-xs text-text-default'>
|
|
263
|
+
font-serif / text-xl — IBM Plex Serif
|
|
264
|
+
</p>
|
|
265
|
+
<p className='font-mono text-m text-text-default'>
|
|
266
|
+
font-mono / text-m — Source Code Pro
|
|
267
|
+
</p>
|
|
268
|
+
</section>
|
|
269
|
+
|
|
270
|
+
{/* ── Border Radius ───────────────────────────────────────── */}
|
|
271
|
+
<section className='mb-2xl'>
|
|
272
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>
|
|
273
|
+
Border Radius
|
|
274
|
+
</h2>
|
|
275
|
+
<div className='flex gap-m flex-wrap'>
|
|
276
|
+
{[
|
|
277
|
+
'rounded',
|
|
278
|
+
'rounded-button',
|
|
279
|
+
'rounded-input',
|
|
280
|
+
'rounded-container',
|
|
281
|
+
'rounded-bar',
|
|
282
|
+
'rounded-full',
|
|
283
|
+
].map((cls) => (
|
|
284
|
+
<div
|
|
285
|
+
key={cls}
|
|
286
|
+
className={`${cls} bg-brand-primary-200 p-m text-s text-text-default`}
|
|
287
|
+
>
|
|
288
|
+
{cls}
|
|
289
|
+
</div>
|
|
290
|
+
))}
|
|
291
|
+
</div>
|
|
292
|
+
</section>
|
|
293
|
+
|
|
294
|
+
{/* ── Z-index ─────────────────────────────────────────────── */}
|
|
295
|
+
<section className='mb-2xl'>
|
|
296
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>Z-index</h2>
|
|
297
|
+
<div className='relative h-xl'>
|
|
298
|
+
<div className='absolute z-navigation bg-brand-primary-200 p-xs rounded text-xs text-text-default'>
|
|
299
|
+
z-navigation (100)
|
|
300
|
+
</div>
|
|
301
|
+
</div>
|
|
302
|
+
<p className='text-s text-text-secondary mt-xs'>
|
|
303
|
+
Inspect computed style to confirm z-index values resolve correctly.
|
|
304
|
+
</p>
|
|
305
|
+
</section>
|
|
306
|
+
|
|
307
|
+
{/* ── Max Width ───────────────────────────────────────────── */}
|
|
308
|
+
<section className='mb-2xl'>
|
|
309
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>
|
|
310
|
+
Max Width
|
|
311
|
+
</h2>
|
|
312
|
+
<div className='max-w-narrow bg-bg-secondary p-m rounded-container mb-s border border-border-default'>
|
|
313
|
+
<span className='text-s text-text-default'>
|
|
314
|
+
max-w-narrow (1024px)
|
|
315
|
+
</span>
|
|
316
|
+
</div>
|
|
317
|
+
<div className='max-w-standard bg-bg-secondary p-m rounded-container border border-border-default'>
|
|
318
|
+
<span className='text-s text-text-default'>
|
|
319
|
+
max-w-standard (1200px)
|
|
320
|
+
</span>
|
|
321
|
+
</div>
|
|
322
|
+
</section>
|
|
323
|
+
|
|
324
|
+
{/* ── Dark Mode ───────────────────────────────────────────── */}
|
|
325
|
+
<section className='mb-2xl'>
|
|
326
|
+
<h2 className='text-l font-semibold mb-m text-text-default'>
|
|
327
|
+
Dark Mode
|
|
328
|
+
</h2>
|
|
329
|
+
<p className='text-s text-text-secondary mb-m'>
|
|
330
|
+
The box below manually applies the PDS dark theme attribute. Colors
|
|
331
|
+
inside should switch — no Tailwind dark: prefix needed.
|
|
332
|
+
</p>
|
|
333
|
+
<div data-theme='dark' className='p-xl rounded-container'>
|
|
334
|
+
<div className='bg-bg-default p-m rounded-container'>
|
|
335
|
+
<p className='text-text-default text-m font-semibold'>
|
|
336
|
+
Dark bg-default
|
|
337
|
+
</p>
|
|
338
|
+
<p className='text-text-secondary text-s'>Dark text-secondary</p>
|
|
339
|
+
<div className='mt-m p-m rounded-container bg-status-info-background'>
|
|
340
|
+
<span className='text-status-info-foreground text-s'>
|
|
341
|
+
Dark status-info
|
|
342
|
+
</span>
|
|
343
|
+
</div>
|
|
344
|
+
</div>
|
|
345
|
+
</div>
|
|
346
|
+
</section>
|
|
347
|
+
</div>
|
|
348
|
+
);
|
|
349
|
+
}
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Checklist
|
|
355
|
+
|
|
356
|
+
Work through both projects and check each item. Open browser DevTools to
|
|
357
|
+
inspect computed styles when you need to verify a value resolves correctly.
|
|
358
|
+
|
|
359
|
+
### Preflight
|
|
360
|
+
|
|
361
|
+
- [ ] Browser default margins on `<h1>`, `<p>`, `<ul>` are **not** reset (preflight is disabled — headings should still have default browser size/weight until you explicitly set them)
|
|
362
|
+
- [ ] PDS base styles from `pds-core.css` are applied (e.g. correct font on `body`)
|
|
363
|
+
- [ ] Borders only appear on elements that explicitly include `border-solid` — no global border bleed (preflight normally sets `border-style: solid` globally; without it you must add `border-solid` per element)
|
|
364
|
+
|
|
365
|
+
### Colors — backgrounds and foregrounds
|
|
366
|
+
|
|
367
|
+
- [ ] `bg-bg-default` renders white (light mode)
|
|
368
|
+
- [ ] `bg-bg-secondary` renders light gray
|
|
369
|
+
- [ ] `bg-bg-reverse` renders dark
|
|
370
|
+
- [ ] `text-fg-reverse` is visible on `bg-bg-reverse`
|
|
371
|
+
- [ ] `text-fg-default` and `text-fg-secondary` are both visible on light surfaces
|
|
372
|
+
|
|
373
|
+
### Colors — status
|
|
374
|
+
|
|
375
|
+
- [ ] All five status backgrounds render distinct colors (info, success, warning, critical, discovery)
|
|
376
|
+
- [ ] Status foreground text is readable on its status background
|
|
377
|
+
- [ ] Status border color is visible when `border border-solid border-status-info-border` is applied
|
|
378
|
+
- [ ] Status dot colors render as small circles
|
|
379
|
+
|
|
380
|
+
### Colors — data visualization
|
|
381
|
+
|
|
382
|
+
- [ ] `bg-datavis-1` through `bg-datavis-5` each render a distinct color
|
|
383
|
+
|
|
384
|
+
### Dark mode
|
|
385
|
+
|
|
386
|
+
- [ ] Inside `data-theme="dark"`, `bg-bg-default` renders dark (not white)
|
|
387
|
+
- [ ] `text-fg-default` is light-colored inside the dark section
|
|
388
|
+
- [ ] Status colors shift appropriately in dark mode
|
|
389
|
+
- [ ] No Tailwind `dark:` prefix was needed — color changes happen via CSS vars
|
|
390
|
+
|
|
391
|
+
### Interactive
|
|
392
|
+
|
|
393
|
+
- [ ] `text-interactive-link` renders the PDS link color
|
|
394
|
+
- [ ] `:hover` changes to `text-interactive-link-hover` (test in browser)
|
|
395
|
+
|
|
396
|
+
### Spacing
|
|
397
|
+
|
|
398
|
+
- [ ] `gap-m`, `p-xl`, `mb-2xl` all produce visible spacing
|
|
399
|
+
- [ ] Inspect computed style on a `p-m` element — should show the rem value from `--pds-spacing-m`
|
|
400
|
+
- [ ] `gap-xs` in the spacing row produces tighter gaps than `gap-m`
|
|
401
|
+
|
|
402
|
+
### Typography
|
|
403
|
+
|
|
404
|
+
- [ ] `text-xs` is noticeably smaller than `text-xl`
|
|
405
|
+
- [ ] `font-semibold` is visually heavier than `font-normal`
|
|
406
|
+
- [ ] PDS body font (Inter) is applied globally via `pds-core.css` — no Tailwind font-family utility needed
|
|
407
|
+
|
|
408
|
+
### Border radius
|
|
409
|
+
|
|
410
|
+
- [ ] `rounded` (DEFAULT) is slightly rounded
|
|
411
|
+
- [ ] `rounded-input` is slightly more rounded than `rounded`
|
|
412
|
+
- [ ] `rounded-container` is more rounded than `rounded-input`
|
|
413
|
+
- [ ] `rounded-button` and `rounded-bar` are pill-shaped (both map to `--pds-border-radius-button` / `--pds-border-radius-bar`)
|
|
414
|
+
|
|
415
|
+
### Z-index
|
|
416
|
+
|
|
417
|
+
- [ ] Inspect computed `z-index` on `z-navigation` element — should be `100`
|
|
418
|
+
- [ ] `z-modal` should compute to `900`
|
|
419
|
+
|
|
420
|
+
### Max width
|
|
421
|
+
|
|
422
|
+
- [ ] `max-w-narrow` constrains width at 1024px
|
|
423
|
+
- [ ] `max-w-standard` is wider than `max-w-narrow`
|
|
424
|
+
- [ ] `max-w-wide` is wider than `max-w-standard`
|
|
425
|
+
- [ ] `max-w-x-wide` is wider than `max-w-wide`
|
|
426
|
+
- [ ] All four blocks visually confirm the width difference on a wide viewport
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
## v4-Specific Checks
|
|
431
|
+
|
|
432
|
+
- [ ] No `tailwind.config.js` exists in the project — v4 works without it
|
|
433
|
+
- [ ] Removing the `@import 'tailwindcss/theme'` line breaks utilities (confirms the layer import is working)
|
|
434
|
+
- [ ] Swap to `@import 'tailwindcss'` (the shorthand) — verify preflight fires and breaks PDS styles, then revert
|
|
435
|
+
- [ ] Inspect `--color-bg-default` in DevTools `:root` — should be present as a CSS custom property
|
|
436
|
+
|
|
437
|
+
## v3-Specific Checks
|
|
438
|
+
|
|
439
|
+
- [ ] `tailwind.config.js` preset resolves without error on startup
|
|
440
|
+
- [ ] Running `npx tailwindcss --content './app/**/*.tsx' --input ./app/globals.css` produces output CSS with PDS class names
|
|
441
|
+
- [ ] `p-4` generates output and resolves to the same value as `p-m` (confirms numeric alias is working)
|
|
442
|
+
- [ ] `p-7` generates no output (confirms unmapped in-between values are intentionally excluded)
|
|
443
|
+
- [ ] Adding a truly unknown class (e.g. `p-99`) produces nothing in the output
|
|
444
|
+
|
|
445
|
+
---
|
|
446
|
+
|
|
447
|
+
## If Something Doesn't Work
|
|
448
|
+
|
|
449
|
+
| Symptom | Likely cause |
|
|
450
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- |
|
|
451
|
+
| All colors render as empty / transparent | `pds-core.css` not loaded before Tailwind, or CSS vars not resolving |
|
|
452
|
+
| Preflight styles are active | v4: Using `@import 'tailwindcss'` shorthand instead of individual layers |
|
|
453
|
+
| Utility classes not generated | v3: `content` array doesn't match file paths; v4: files outside auto-scan root |
|
|
454
|
+
| Font doesn't change to Inter | Google Fonts not loaded — pds-core.css includes the font import, confirm it is loading before Tailwind |
|
|
455
|
+
| Dark mode section looks identical to light | `pds-core.css` dark mode vars may need `data-theme="dark"` on a parent element — check the PDS dark mode implementation |
|
|
456
|
+
| `rounded-button` same as `rounded` | Expected — they share the same token value (`--pds-border-radius-button` = `--pds-border-radius-default`) |
|
|
457
|
+
| Borders invisible despite `border` class | Preflight is disabled — add `border-solid` alongside every `border` class. Without preflight, `border-style` defaults to `none` |
|