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

FormControl + Autocomplete component updates #2075

Merged
merged 24 commits into from
May 26, 2022

Conversation

langermank
Copy link
Contributor

@langermank langermank commented May 10, 2022

What are you trying to accomplish?

While working on bringing the PVC Autocomplete component up to design specs, I noticed we had some custom CSS specific for Autocomplete rather than sharing more with generic form styles. I worked on aligning props in Autocomplete with PRC, and built some prototypes for how the markup would look for all form components (input, select, checkbox to start).

What should reviewers focus on?

This will immediately be used for Autocomplete, and other form components are still in progress. For this PR, I would focus on text-input type styles specifically.

For now, testing can be done in the PVC PR: primer/view_components#1163

Can these changes ship as is?

  • Yes, this PR does not depend on additional changes. 🚢

Remaining things to do:

  • Add fallbacks for new design tokens
  • Copy HTML from PVC into docs in PCSS, maybe hidden docs? Where should these docs live if not in PVC exclusively?

@changeset-bot
Copy link

changeset-bot bot commented May 10, 2022

🦋 Changeset detected

Latest commit: 81510ca

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

This PR includes changesets to release 1 package
Name Type
@primer/css 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

@langermank langermank temporarily deployed to github-pages May 20, 2022 23:18 Inactive
@langermank langermank marked this pull request as ready for review May 20, 2022 23:29
@langermank langermank requested a review from a team as a code owner May 20, 2022 23:29
@langermank langermank requested a review from jonrohan May 20, 2022 23:29
@langermank langermank changed the title [Draft] Form control component updates FormControl + Autocomplete component updates May 20, 2022
@langermank langermank temporarily deployed to github-pages May 22, 2022 00:41 Inactive
@langermank langermank temporarily deployed to github-pages May 22, 2022 15:17 Inactive
// stylelint-disable primer/typography, primer/borders, primer/spacing, primer/box-shadow, max-nesting-depth

:root {
accent-color: var(--color-accent-fg);
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit general. Should we focus it to the selector using it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it only applies to a few input elements by default https://developer.mozilla.org/en-US/docs/Web/CSS/accent-color

BUT, I removed it anyways. We're adding custom Checkbox/Radio styles instead of relying on browser defaults going forward.

Copy link
Contributor

Choose a reason for hiding this comment

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

If we wanted to add it for all "native" controls, maybe native.scss would be a good place. It's where we have the color-scheme and Windows High Contrast mode styles.

@langermank langermank temporarily deployed to github-pages May 26, 2022 01:31 Inactive
Copy link
Contributor

@simurai simurai left a comment

Choose a reason for hiding this comment

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

Just based on the PVC docs, looks good.

The only small tweak I found is nudging the clear button 2px to the left?

Screen Shot 2022-05-26 at 12 36 32

And I assume there will be more follow-up changes when implementing the other FormControls in PVC.

Comment on lines -49 to -50
- title: Autocomplete
url: /components/autocomplete
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 On just removing the nav item for now.

Internal discussion around not having to maintain documentation in PCSS AND PVC.

pointer-events: none;
content: '';
background-color: var(--color-fg-muted);
mask: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0iIzU4NjA2OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNNC40MjcgOS40MjdsMy4zOTYgMy4zOTZhLjI1MS4yNTEgMCAwMC4zNTQgMGwzLjM5Ni0zLjM5NkEuMjUuMjUgMCAwMDExLjM5NiA5SDQuNjA0YS4yNS4yNSAwIDAwLS4xNzcuNDI3ek00LjQyMyA2LjQ3TDcuODIgMy4wNzJhLjI1LjI1IDAgMDEuMzU0IDBMMTEuNTcgNi40N2EuMjUuMjUgMCAwMS0uMTc3LjQyN0g0LjZhLjI1LjI1IDAgMDEtLjE3Ny0uNDI3eiIgLz48L3N2Zz4=');
Copy link
Contributor

@simurai simurai May 26, 2022

Choose a reason for hiding this comment

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

Is browser support ok for mask? Not sure if it's https://caniuse.com/css-masks. autoprefixer might add -webkit-?

@langermank langermank merged commit 9f576a3 into main May 26, 2022
@langermank langermank deleted the form-control-component-updates branch May 26, 2022 17:39
@primer-css primer-css mentioned this pull request May 26, 2022
@langermank langermank temporarily deployed to github-pages May 26, 2022 17:43 Inactive
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.

4 participants