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

Implement color theming support #199

Merged
merged 6 commits into from
Aug 23, 2024
Merged

Conversation

jordanjones243
Copy link
Contributor

@jordanjones243 jordanjones243 commented Aug 13, 2024

Alaska Airlines Pull Request

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Resolves: #198

Summary:

Please summarize the scope of the changes you have submitted, what the intent of the work is and anything that describes the before/after state of the project.

  • Update dependencies
  • Implement custom versioned auro-dropdown component
  • Implement tier 3 color tokens

Type of change:

Please delete options that are not relevant.

  • New capability
  • Revision of an existing capability
  • Infrastructure change (automation, etc.)
  • Other (please elaborate)

Checklist:

  • My update follows the CONTRIBUTING guidelines of this project
  • I have performed a self-review of my own update

By submitting this Pull Request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Pull Requests will be evaluated by their quality of update and whether it is consistent with the goals and values of this project. Any submission is to be considered a conversation between the submitter and the maintainers of this project and may require changes to your submission.

Thank you for your submission!

-- Auro Design System Team

Summary by Sourcery

Implement color theming support by adding tier 3 color tokens and refactor the auro-dropdown component to use a custom versioned tag. Update documentation and tests to reflect these changes, and remove deprecated husky script.

New Features:

  • Implement color theming support by introducing tier 3 color tokens and allowing components to be restyled using new SCSS variables.

Enhancements:

  • Refactor the auro-dropdown component to use a custom versioned tag for better dependency management.

Documentation:

  • Update documentation to include information on theme support and how to restyle components using new tokens.

Tests:

  • Update tests to accommodate changes in the auro-dropdown component's query selector.

Chores:

  • Remove deprecated husky script and update ESLint configuration to use a new module-based setup.

@jordanjones243 jordanjones243 self-assigned this Aug 13, 2024
@jordanjones243 jordanjones243 requested a review from a team as a code owner August 13, 2024 18:09
@jordanjones243 jordanjones243 linked an issue Aug 13, 2024 that may be closed by this pull request
2 tasks
Copy link

sourcery-ai bot commented Aug 13, 2024

Reviewer's Guide by Sourcery

This pull request implements color theming support and introduces a custom versioned auro-dropdown component. The changes focus on enhancing the auro-select component with dynamic component tags, updating the styling to use new SCSS variables for theming, and improving the overall structure and flexibility of the component.

Key implementation details:

  1. A new dropdownTag property is added to dynamically generate the tag for the auro-dropdown component, improving versioning and flexibility.
  2. The styling is updated to use new color tokens and SCSS variables, allowing for easier theming.
  3. The component's template is refactored to use the dynamic dropdownTag and move the help text inside the dropdown component.
  4. New files are added for color styling (color.scss) and token definitions (tokens.scss).
  5. The build and linting setup is updated, including the addition of a new ESLint configuration file.

These changes significantly improve the component's customizability and maintainability while introducing theme support.

File-Level Changes

Files Changes
src/auro-select.js Implement custom versioned auro-dropdown component with dynamic tag generation
src/style.scss
src/color.scss
src/tokens.scss
Update styling to use new color tokens and SCSS variables for theming support
src/auro-select.js Refactor component template to use dynamic dropdownTag and relocate help text
demo/api.md
docs/partials/api.md
Update documentation to include information on theme support
test/auro-select.test.js Modify tests to accommodate changes in auro-dropdown component selection logic
.husky/_/husky.sh
eslint.config.mjs
Update build and linting setup, including new ESLint configuration
README.md
scripts/generateDocs.mjs
scripts/postCss.mjs
scripts/staticStyles-template.js
Remove deprecated scripts and update README

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jordanjones243 - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 2 issues found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

test/auro-select.test.js Show resolved Hide resolved
demo/api.md Outdated Show resolved Hide resolved
demo/api.md Outdated Show resolved Hide resolved
@jordanjones243 jordanjones243 force-pushed the jjones/themeSupport/#198 branch 2 times, most recently from 2bd2757 to 04d6915 Compare August 15, 2024 18:21
Copy link
Member

@jason-capsule42 jason-capsule42 left a comment

Choose a reason for hiding this comment

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

Screenshot 2024-08-18 at 5 23 18 PM The selected value is not rendering correctly in the menu for me.

.husky/_/husky.sh Outdated Show resolved Hide resolved
src/color.scss Outdated Show resolved Hide resolved
@jason-capsule42
Copy link
Member

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @jordanjones243 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The removal of the CSS custom property fallbacks section from the README might impact users supporting older browsers. Was this intentional, and if so, how should users handle fallbacks now?
  • Some specific color styles have been removed from style.scss. Please confirm that these are now properly handled by the new color theming system and that there are no unintended side effects from this change.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟡 Testing: 1 issue found
  • 🟢 Complexity: all looks good
  • 🟡 Documentation: 1 issue found

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -112,7 +112,7 @@ describe('auro-select', () => {

await elementUpdated(el);

const dropdown = el.shadowRoot.querySelector('auro-dropdown');
const dropdown = el.shadowRoot.querySelector('[auro-dropdown]');
const triggerContentHTML = dropdown.querySelector('#triggerFocus').innerHTML;

await expect(el.optionSelected).to.be.equal(undefined);
Copy link

Choose a reason for hiding this comment

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

suggestion (testing): Add tests for new color theming support

The pull request implements color theming support, but there are no tests to verify this new functionality. Consider adding tests that check if the component correctly applies theme-related CSS variables and classes.

Suggested change
await expect(el.optionSelected).to.be.equal(undefined);
await expect(el.optionSelected).to.be.equal(undefined);
// Test color theming support
el.setAttribute('theme', 'dark');
await el.updateComplete;
expect(el.classList.contains('auro-select--dark')).to.be.true;
el.setAttribute('theme', 'light');
await el.updateComplete;
expect(el.classList.contains('auro-select--light')).to.be.true;

Comment on lines -75 to -82
### CSS Custom Property fallbacks

<!-- AURO-GENERATED-CONTENT:START (REMOTE:url=https://raw.githubusercontent.com/AlaskaAirlines/WC-Generator/master/componentDocs/partials/usage/cssFallbacks.md) -->
[CSS custom properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) are [not supported](https://auro.alaskaair.com/support/custom-properties) in older browsers. For this, fallback properties are pre-generated and included with the npm.

Any update to the Auro Design Tokens will be immediately reflected with browsers that support CSS custom properties, legacy browsers will require updated components with pre-generated fallback properties.

<!-- AURO-GENERATED-CONTENT:END -->
Copy link

Choose a reason for hiding this comment

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

question (documentation): Removal of CSS Custom Property fallbacks section

Could you provide the rationale for removing this section? It contained information about browser support for CSS custom properties, which might still be relevant for users supporting older browsers.

@jordanjones243
Copy link
Contributor Author

PR was approved with @jason-capsule42 during pair programming and I will therefore be forcing a release.

@jordanjones243 jordanjones243 merged commit 3334514 into beta Aug 23, 2024
4 checks passed
@jordanjones243 jordanjones243 deleted the jjones/themeSupport/#198 branch August 23, 2024 19:57
@blackfalcon
Copy link
Member

🎉 This PR is included in version 2.11.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

Update color tokens for theming support
3 participants