Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(styles): add playground setup #3610

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
"demo:lint": "pnpm --filter design-system-demo lint",
"docs": "pnpm docs:start",
"docs:only": "pnpm --filter design-system-documentation start",
"docs:start": "pnpm --filter design-system-tokens build && pnpm --filter design-system-documentation... --parallel --stream start",
"docs:start": "pnpm --filter design-system-tokens build && pnpm --filter design-system-documentation... --parallel --stream start",
"docs:build": "pnpm --filter design-system-documentation build",
"docs:headless": "pnpm --filter design-system-documentation start:headless",
"docs:test": "pnpm --filter design-system-documentation test",
"docs:e2e": "start-server-and-test docs:headless 9001 'pnpm --filter design-system-documentation e2e'",
"docs:e2e:watch": "start-server-and-test docs:headless 9001 'pnpm --filter design-system-documentation e2e:watch'",
"styles": "pnpm styles:start",
"styles:start": "pnpm --filter design-system-styles start",
"styles:play": "pnpm --filter design-system-styles play",
"styles:build": "pnpm --filter design-system-styles build",
"styles:lint": "pnpm --filter design-system-styles lint",
"styles:lint:fix": "pnpm --filter design-system-styles lint:fix",
Expand Down
36 changes: 36 additions & 0 deletions packages/styles/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Styles playground</title>
<link id="tokens" rel="stylesheet" href="src/post-tokens-external.scss" />
<link rel="stylesheet" href="src/elements/_index.scss" />
<link rel="stylesheet" href="src/components/_index.scss" />
</head>
<body class="p-4">
<h1>Styles package playground</h1>
<p class="mb-4">
Use this playground for quickly developing HTML/CSS components. Run
<code style="background-color: lightgrey; padding: 0.125rem 0.25rem; border-radius: 0.25rem"
>pnpm styles:start</code
>
to get going.
</p>
<label for="tokens-select">Select tokens package: </label>
<select
name="tokens"
id="tokens-select"
value="external"
class="mb-4"
onchange="document.getElementById('tokens').setAttribute('href', `/src/post-tokens-${this.value}.scss`)"
Dismissed Show dismissed Hide dismissed
>
<option value="external">Post external</option>
<option value="internal">Post internal</option>
</select>
<hr />

<!-- Place your component markup here -->
<button class="btn btn-primary">Primary button</button>
</body>
</html>
6 changes: 4 additions & 2 deletions packages/styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
},
"scripts": {
"start": "gulp watch",
"play": "vite --open",
"build": "pnpm clean && gulp build",
"unit": "gulp sass:tests",
"clean": "rimraf out-tsc dist",
Expand Down Expand Up @@ -47,8 +48,8 @@
"bootstrap": "5.3.3"
},
"devDependencies": {
"@swisspost/design-system-tokens": "workspace:9.0.0-next.0",
"@swisspost/design-system-icons": "workspace:9.0.0-next.0",
"@swisspost/design-system-tokens": "workspace:9.0.0-next.0",
"@types/node": "20.14.14",
"autoprefixer": "10.4.19",
"copyfiles": "2.4.1",
Expand All @@ -67,7 +68,8 @@
"stylelint-config-sass-guidelines": "11.1.0",
"stylelint-prettier": "5.0.2",
"stylelint-scss": "6.5.1",
"typescript": "5.5.4"
"typescript": "5.5.4",
"vite": "5.4.8"
},
"sass": {
"includePaths": [
Expand Down
Loading