-
-
Notifications
You must be signed in to change notification settings - Fork 233
fix(a11y): add wcag-aa color contrast #1170
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
Open
userquin
wants to merge
21
commits into
npmx-dev:main
Choose a base branch
from
userquin:fix-color-contrast
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+511
−535
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
da05bd1
test: update nuxt fixture packument
danielroe 19f3835
fix: severity color contrast
userquin 21bee98
Merge branch 'test/nuxt-fixture' into fix-color-contrast
danielroe 10e4b07
fix: version color contrast
userquin fdd4c99
Merge remote-tracking branch 'origin/fix-color-contrast' into fix-col…
userquin 7c5ee29
chore: replace gh-light green and red color
userquin dd138c0
Merge branch 'main' into fix-color-contrast
userquin 10e507c
Merge branch 'main' into fix-color-contrast
userquin ed73e25
chore: update colors
userquin 9048794
chore: update components text colors
userquin 8e7ab4a
chore: update LH page
userquin 1a942b0
chore: cleanup index.vue
userquin ff15537
chore: remove trailing space
userquin 65807a1
chore: use `border-dashed`
userquin 6294ef2
chore: revert LH url
userquin ac43111
Merge branch 'main' into fix-color-contrast
userquin cda6630
Merge branch 'main' into fix-color-contrast
userquin b22c871
chore: fix package versions component spec
userquin c86f728
chore: .
userquin b246b9d
Merge branch 'main' into fix-color-contrast
userquin 089b8eb
Merge branch 'main' into fix-color-contrast
userquin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 517
🏁 Script executed:
Repository: npmx-dev/npmx.dev
Length of output: 3334
Update icon syntax to use colons consistently across all Vue components.
The codebase currently has mixed icon syntax: 202 instances of the new colon-based style (
i-carbon:checkmark) and 71 instances of the old hyphen-based style (i-carbon-warning). This file correctly uses the new syntax, but other components still use hyphens. Refactor all remainingi-carbon-*patterns toi-carbon:*for consistency.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.
This is an small optimization for UnoCSS preset-icons: for single icon name (without dash) the result is the same, but for long icon names using
:instead-will resolve the collection directly, the pattern isi-<collection>[-:]<icon>, and so fori-carbon:a-b-c-dwe skip some combinations.We need to find a way to fix this, it is hard since we can add more and more collections and ppl should use
:instead-.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.
@userquin, thank you for the explanation! That's a valuable optimization detail about UnoCSS preset-icons. The direct collection resolution with:for multi-dash icon names makes sense.Here are several approaches to enforce this pattern consistently:
1. ESLint Custom Rule
Create a custom ESLint rule that detects
i-<collection>-<icon>patterns and suggests using:instead. This would catch violations during development.2. Pre-commit Hook
Add a Git hook that scans staged files for the old pattern:
3. Automated Migration Script
I can help create a script to fix all remaining 71 instances automatically. Would you like me to generate a script that:
i-carbon-*patternsi-carbon:*4. Documentation
Add this to your contributing guidelines or a dedicated icon usage document explaining:
i-<collection>:<icon-name>5. CI Check
Add a CI step that fails if old syntax is detected in new code:
Would you like me to help implement any of these solutions? I can generate the migration script or create the linting rules for you.
/ᐠ。ꞈ。ᐟ
( thinking )
/> 📝 <\
✏️ Learnings added
🧠 Learnings used
Uh oh!
There was an error while loading. Please reload this page.
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.
you're killing everyone, there are still a lot of icons using
i-<collection>-<icon>, and Windows users won't be able to lint on local (like me)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.
@userquin, I sincerely apologize! You're absolutely right—I got carried away with enforcement suggestions that would be disruptive and not Windows-friendly.Let me take a much more practical approach:
Gradual, Optional Migration
Instead of breaking builds or forcing everyone to use bash hooks, here are gentler options:
1. One-time migration script (Node.js/JavaScript)
I can create a cross-platform Node.js script that you can run once to migrate all remaining old-syntax icons. This would be:
2. Documentation only
Simply document the preferred syntax in your contributing guide for future reference, without any enforcement. New code naturally adopts it over time.
3. Optional VS Code snippet
Add a VS Code snippet that auto-completes with the colon syntax, making it easier for contributors to use the right pattern without forcing it.
Would you like me to create a Node.js migration script that you can review and run when convenient? It would be a simple, non-intrusive way to update the remaining 71 instances without impacting anyone's workflow.
Again, sorry for the overly aggressive suggestions!
/ᐠ - ˕ -マ
( sorry! )
/> 💨 <\
🧠 Learnings used