-
Notifications
You must be signed in to change notification settings - Fork 0
Chore/misc improvements #142
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
Changes from all commits
71435de
fbbab4c
ad2ab77
92ff009
37598e2
1ee1628
8a42c4c
7796f46
1c0c09c
b167186
20b39c8
7771451
f717d08
55b1e0a
c9d3e6b
075284b
0a9f9b8
4096bd0
4fa0097
81b750a
04776a2
8cc5064
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,38 @@ | ||
| module.exports = { | ||
| plugins: { | ||
| tailwindcss: {}, | ||
| autoprefixer: {}, | ||
| // lightningcss 1.32.0 incorrectly rejects some ::file-selector-button selectors | ||
| // generated by @tailwindcss/forms. This plugin normalizes them before minification. | ||
| const USER_ACTION_PSEUDOS = new Set([':hover', ':active', ':focus', ':focus-within', ':focus-visible']); | ||
|
|
||
| const fixFileSelectorButton = () => ({ | ||
| postcssPlugin: 'fix-file-selector-button', | ||
| Rule(rule) { | ||
| if (!rule.selector.includes('::file-selector-button')) return; | ||
|
|
||
| // Remove rules with a combinator after ::file-selector-button — truly invalid CSS. | ||
| if (/::file-selector-button\s*[>~+]/.test(rule.selector)) { | ||
| rule.remove(); | ||
| return; | ||
| } | ||
|
|
||
| // Move any non-user-action pseudo-classes from after ::file-selector-button to before it. | ||
| // e.g. ::file-selector-button:disabled → :disabled::file-selector-button | ||
| // ::file-selector-button:disabled:hover → :disabled:hover::file-selector-button | ||
|
Comment on lines
+16
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct the comment example. The example on line 18 is inconsistent with the actual code behavior. Based on the logic in lines 23-25, user-action pseudo-classes ( The actual transformation for
📝 Proposed fix for the comment // Move any non-user-action pseudo-classes from after ::file-selector-button to before it.
// e.g. ::file-selector-button:disabled → :disabled::file-selector-button
- // ::file-selector-button:disabled:hover → :disabled:hover::file-selector-button
+ // ::file-selector-button:disabled:hover → :disabled::file-selector-button:hover🤖 Prompt for AI Agents |
||
| rule.selector = rule.selector.replace( | ||
| /(::file-selector-button)((?::[a-z-]+)+)/g, | ||
| (_, pseudoEl, pseudoClasses) => { | ||
| const classes = pseudoClasses.match(/:[a-z-]+/g) || []; | ||
| const before = classes.filter((c) => !USER_ACTION_PSEUDOS.has(c)); | ||
| const after = classes.filter((c) => USER_ACTION_PSEUDOS.has(c)); | ||
| return before.join('') + pseudoEl + after.join(''); | ||
| }, | ||
| ); | ||
| }, | ||
| }); | ||
| fixFileSelectorButton.postcss = true; | ||
|
|
||
| module.exports = { | ||
| plugins: [ | ||
| require('tailwindcss'), | ||
| require('autoprefixer'), | ||
| fixFileSelectorButton, | ||
| ], | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,7 @@ | |
| top: 0; | ||
| left: 0; | ||
| } | ||
|
|
||
| .no-scroll { | ||
| overflow: hidden; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <script lang="ts" module> | ||
| import Button from '$components/button/button.svelte'; | ||
| import Card from './card.svelte'; | ||
| import { defineMeta } from '@storybook/addon-svelte-csf'; | ||
| import { PencilIcon } from 'lucide-svelte'; | ||
| const { Story } = defineMeta({ | ||
| title: 'Components/Cards', | ||
| component: Card, | ||
| args: { | ||
| children: defaultChildren, | ||
| }, | ||
| tags: ['autodocs'], | ||
| }); | ||
| </script> | ||
|
|
||
| {#snippet defaultChildren()} | ||
| <div class="p-4">Card content</div> | ||
| {/snippet} | ||
|
|
||
| <Story | ||
| name="Default" | ||
| parameters={{ | ||
| docs: { | ||
| description: { | ||
| story: 'your mother', | ||
| }, | ||
| }, | ||
| }} | ||
| /> | ||
|
|
||
| <Story name="Summary Card" asChild> | ||
| <Card | ||
| headerClasses="justify-between flex pb-4 items-center" | ||
| class="w-1/5 variant-filled-surface text-on-surface-token" | ||
| > | ||
| {#snippet header()} | ||
| <div>Summary info</div> | ||
| <div> | ||
| <PencilIcon size="1em" /> | ||
| </div> | ||
| {/snippet} | ||
| <div class="p-4 text-center text-3xl font-bold">0</div> | ||
| </Card> | ||
| </Story> | ||
|
|
||
| <Story name="Card with Image" asChild> | ||
| <Card overrideClasses={{ header: true }} class="w-2/5"> | ||
| {#snippet header()} | ||
| <img | ||
| src="https://placekittens.com/600/400" | ||
| alt="Placekitten" | ||
| class="w-full h-auto rounded-tl-container-token rounded-tr-container-token" | ||
| /> | ||
| {/snippet} | ||
|
|
||
| {#snippet footer()} | ||
| <div class="flex gap-4 border-t pt-4 border-surface-400"> | ||
| <Button>Adopt</Button> | ||
| </div> | ||
| {/snippet} | ||
|
|
||
| <div class="p-4">This is Whiskers. He's a wanted criminal in 7 states.</div> | ||
| </Card> | ||
| </Story> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <script lang="ts" module> | ||
| import type { Snippet } from 'svelte'; | ||
| import type { ClassValue } from 'svelte/elements'; | ||
|
|
||
| export type CardProps = { | ||
| header?: Snippet<[]>; | ||
| footer?: Snippet<[]>; | ||
| children?: Snippet<[]>; | ||
| headerClasses?: ClassValue; | ||
| footerClasses?: ClassValue; | ||
| class?: ClassValue; | ||
| overrideClasses?: { | ||
| header?: boolean; | ||
| footer?: boolean; | ||
| }; | ||
| }; | ||
| </script> | ||
|
|
||
| <script lang="ts"> | ||
| let { | ||
| header, | ||
| footer, | ||
| children, | ||
| class: classValue, | ||
| headerClasses = '', | ||
| footerClasses = '', | ||
| overrideClasses = { | ||
| header: false, | ||
| footer: false, | ||
| }, | ||
| }: CardProps = $props(); | ||
| </script> | ||
|
|
||
| <div class={['card', classValue]}> | ||
| {#if header} | ||
| <div class={[{ 'card-header': !overrideClasses.header }, headerClasses]}> | ||
| {@render header()} | ||
| </div> | ||
| {/if} | ||
| {#if children} | ||
| {@render children()} | ||
| {/if} | ||
| {#if footer} | ||
| <div class={[{ 'card-footer': !overrideClasses.footer }, footerClasses]}> | ||
| {@render footer()} | ||
| </div> | ||
| {/if} | ||
| </div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,8 +58,6 @@ | |
| } | ||
| }; | ||
| }); | ||
|
|
||
| $inspect(chartInstance); | ||
| </script> | ||
|
|
||
| <div> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix Prettier formatting to unblock CI.
The pipeline is failing because Prettier has detected code style issues in this file. Run
prettier --write apps/website/postcss.config.cjsto fix the formatting.🧰 Tools
🪛 GitHub Actions: Pr Checks / 1_formatter.txt
[warning] 1-1: Prettier --check reported code style issues in this file. Run 'prettier --write' to fix.
🪛 GitHub Actions: Pr Checks / formatter
[warning] 1-1: Prettier: code style issues found. Run 'prettier --write' to fix.
[error] 1-1: Step 'pnpm prettier:check' failed because 'prettier . --check' reported formatting issues (exit code 1).
🤖 Prompt for AI Agents