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

refactor(NumberInput): remove pseudo elements and use box-shadow #15128

Merged

Conversation

tw15egan
Copy link
Collaborator

@tw15egan tw15egan commented Nov 8, 2023

Refs #15115

While working on adding the aura gradient to NumberInput, I realized our use of ::before and ::after elements were causing issues with the underlying backgrounds. This PR removes the usage of these pseudo-elements and instead sets dynamic inset box-shadow's to style the stepper buttons when the input is focused, invalid, or the steppers are hovered while in these states. Also fixes some issues with the current implementation, seen below:

2023-11-08 13 12 11

Changelog

Changed

  • Mimicked the ::before and ::after pseudo-element styles with box-shadow on the stepper buttons.

Removed

  • All styles relating to the ::before and ::after pseudo-elements
  • Some light specific styles that are not doing anything

Testing / Reviewing

Go to NumberInput and Unstable__NumberInput stories, and ensure the stepper styles are correct when the buttons are focused, hovered, hovered when input focused, focused when input invalid, and focused and hovered when input invalid.

@tw15egan tw15egan requested a review from a team as a code owner November 8, 2023 18:15
Copy link

netlify bot commented Nov 8, 2023

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 4321dd2
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/654bd0365f482c0008c30959
😎 Deploy Preview https://deploy-preview-15128--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 8, 2023

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 4321dd2
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/654bd036826ef90008b24dce
😎 Deploy Preview https://deploy-preview-15128--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@andreancardona andreancardona left a comment

Choose a reason for hiding this comment

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

tested and looks good! 🔥

@github-actions github-actions bot added this pull request to the merge queue Nov 9, 2023
@tw15egan tw15egan removed this pull request from the merge queue due to a manual request Nov 9, 2023
@tw15egan tw15egan added this pull request to the merge queue Nov 9, 2023
Merged via the queue into carbon-design-system:main with commit b95c679 Nov 9, 2023
21 checks passed
@tw15egan tw15egan deleted the number-input-style-refactor branch November 9, 2023 19:29
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.

3 participants