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

Suggest ViewComponents on reserved class use #1907

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

neall
Copy link
Contributor

@neall neall commented Mar 30, 2023

Description

When developers use HTML classes that we reserve for Primer ViewCompoents, we want to suggest relevant components they might want to use instead.

Closes Primer#1901

Implementation

This changes the generated static/classes.json file from a pure array of HTML classes to restrict into an object where the keys are those HTML classes and the values are arrays of the Ruby class (or classes) associated with that HTML class.

Merge checklist

  • Added/updated tests
  • [ ] Added/updated documentation
  • [ ] Added/updated previews

@neall neall requested review from a team and camertron March 30, 2023 15:54
@changeset-bot
Copy link

changeset-bot bot commented Mar 30, 2023

🦋 Changeset detected

Latest commit: 5e1269c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/view-components Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@neall neall temporarily deployed to github-pages March 30, 2023 15:58 — with GitHub Actions Inactive
@neall neall force-pushed the neall/suggestions-for-css-class-linting branch from 69641e7 to ed91bb7 Compare March 30, 2023 16:02
@neall neall temporarily deployed to preview March 30, 2023 16:02 — with GitHub Actions Inactive
@neall neall temporarily deployed to github-pages March 30, 2023 16:07 — with GitHub Actions Inactive
@neall neall force-pushed the neall/suggestions-for-css-class-linting branch from ed91bb7 to 845486f Compare March 30, 2023 21:18
@neall neall temporarily deployed to preview March 30, 2023 21:18 — with GitHub Actions Inactive
@neall neall temporarily deployed to github-pages March 30, 2023 21:21 — with GitHub Actions Inactive
When developers use HTML classes that we reserve for Primer
ViewCompoents, we want to suggest relevant components they might want to
use instead.
Copy link
Contributor

@camertron camertron left a comment

Choose a reason for hiding this comment

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

Boom!! Awesome! 🎉

@neall neall merged commit c691fbe into main Mar 30, 2023
@neall neall deleted the neall/suggestions-for-css-class-linting branch March 30, 2023 22:02
This was referenced Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants