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

[REFACTORING] Updating the Tailwind configuration file with a new dynamic opacity placeholder for colors #851

Merged
merged 5 commits into from
May 10, 2023
Merged

[REFACTORING] Updating the Tailwind configuration file with a new dynamic opacity placeholder for colors #851

merged 5 commits into from
May 10, 2023

Conversation

blanklob
Copy link
Contributor

@blanklob blanklob commented May 7, 2023

WHY are these changes introduced?

These changes are being implemented to update the Tailwind configuration to include the new opacity color modifier, the special <alpha-value> placeholder. This will involve removing the old implementation with the withOpacity function. The new implementation will allow for greater customization and flexibility in the config. Additionally, this change will ensure that the project remains up-to-date with the latest tailwind standards.

WHAT is this pull request doing?

This PR remove the old implementation with the withOpacity function in the tailwind.config.js file and replaces it with the the new <alpha-value> placeholder.

HOW to test your changes?

  1. Ensured that tailwind.config.js is valid during development in the demo store template.
  2. Verified that color variants work with opacity value modifiers.
  3. No unit-tests are required as well as docs to be added.

Post-merge steps

Checklist

  • I've read the Contributing Guidelines
  • I've considered possible cross-platform impacts (Mac, Linux, Windows)
  • I've added a changeset if this PR contains user-facing or noteworthy changes
  • I've added tests to cover my changes
  • I've added or updated the documentation

@blanklob blanklob changed the title [REFACTORING] Updating the Tailwind configuration file with a new dynamic opacity modifier for colors [REFACTORING] Updating the Tailwind configuration file with a new dynamic opacity placeholder for colors May 7, 2023
Copy link
Contributor

@frandiox frandiox left a comment

Choose a reason for hiding this comment

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

Hi, thanks for this update! I like this format more than the previous one 👍

Can you add a changeset to this PR (make sure the project is set to "demo-store") and check the change request comment below?

Comment on lines 10 to 13
primary: 'rgba(var(--color-primary), <alpha-value>)',
contrast: 'rgba(var(--color-contrast), <alpha-value>)',
notice: 'rgba(var(--color-accent), <alpha-value>)',
shopPay: 'rgba(var(--color-shop-pay), <alpha-value>)',
Copy link
Contributor

Choose a reason for hiding this comment

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

rgba seems to be considered legacy and it doesn't work for me in the current version of Tailwind. It works with the modern rgb, though.

Suggested change
primary: 'rgba(var(--color-primary), <alpha-value>)',
contrast: 'rgba(var(--color-contrast), <alpha-value>)',
notice: 'rgba(var(--color-accent), <alpha-value>)',
shopPay: 'rgba(var(--color-shop-pay), <alpha-value>)',
primary: 'rgb(var(--color-primary) / <alpha-value>)',
contrast: 'rgb(var(--color-contrast) / <alpha-value>)',
notice: 'rgb(var(--color-accent) / <alpha-value>)',
shopPay: 'rgb(var(--color-shop-pay) / <alpha-value>)',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great, and thanks just made the requested changes.

@frandiox frandiox merged commit d450e1c into Shopify:2023-04 May 10, 2023
@blanklob blanklob deleted the feat/tailwind-config-refactoring branch May 11, 2023 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants