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

Allow more CSS custom properties on cds-accordion-header #278

Closed
yuhsianw opened this issue Nov 15, 2023 · 2 comments
Closed

Allow more CSS custom properties on cds-accordion-header #278

yuhsianw opened this issue Nov 15, 2023 · 2 comments

Comments

@yuhsianw
Copy link
Contributor

yuhsianw commented Nov 15, 2023

Please review our Contribution guide for more details about how to contribute effectively.

Summary

Describe the change or feature in detail. Try to answer the following questions.

  • What is the change?

    Add --box-shadow, --icon-visibility, and --icon-margin CSS custom properties to cds-accordion-header.

  • Why should it go in Clarity?

    This will allow Clarity users to extend the Clarity Core Accordion and build a stepper component with a look and feel that matches the Clarity Angular Stepper.

  • Does this change impact existing behaviors? If so how?

    It will not change existing behaviors.

  • If this change introduces a new behavior, is this behavior accessible?

    N/A.

Use case

Provide some specific details about how this change would improve your application and use case.
The added CSS custom properties will allow styling the Core accordion to match the Angular Stepper:

  • --box-shadow for adding panel status indicator color block on the left of the panel header

    Screenshot 2023-11-14 at 23 24 14
  • --icon-visibility for hiding the cds-button-expand in inactive/disabled panels

    Screenshot 2023-11-14 at 23 24 54
  • --icon-margin for aligning the cds-button-expand to the top

    Screenshot 2023-11-14 at 23 25 16

Examples

If possible, show examples of the change. You may create one yourself, or link to external sites that have the idea. It can also be very useful to prototype the idea in isolation outside of Clarity with a Stackblitz example.

API

Describe the intended API for the feature you want to add. This would include:

  • CSS classes and DOM structure for pure static UI contribution, and inputs/outputs, components, directives, services, or anything that is exported publicly for Angular contributions.

    Add --box-shadow, --icon-visibility, and --icon-margin CSS custom properties to cds-accordion-header.

  • Examples of code snippets using this new feature.

    .header {
      --icon-margin: var(--cds-global-space-3) 0 auto 0;
    }
    
    .panel.inactive .header {
      --box-shadow: inset var(--cds-global-space-5) 0 0 var(--cds-alias-status-neutral-tint);
      --icon-visibility: hidden;
    }
  • Note very clearly if anything might be a breaking change.

    No breaking change.

In the case of bug fixes or internal changes, there will most likely be no API changes.

Implementation plan

Describe how you plan to implement the feature, answering questions among the following or anything else you deem relevant.

  • What parts of the code are affected?

    See feat(accordion): add css custom properties #279

  • Will you introduce new services, components or directives?

    No.

  • Can you describe the basic flow of information between classes?

    N/A.

  • Does this introduce asynchronous behaviors?

    No.

  • Will you need to refactor existing Clarity code?

    No.

  • Will reasonable performance require optimizations?

    No.

  • Will it need to access native elements (and be incompatible with server-side rendering)?

    N/A.

  • ...

Conclusion

Describe how long you expect it to take to implement, what help you might need, and any other details that might be helpful. Don't worry, this is obviously non-contractual. 😛
The change is implemented in #279. Looking for reviews and approvals.

williamernest pushed a commit that referenced this issue Nov 17, 2023
## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Tests for the changes have been added (for bug fixes / features)
- [ ] Docs have been added / updated (for bug fixes / features)
- [ ] If applicable, have a visual design approval

## PR Type

What kind of change does this PR introduce?

<!-- Please check the one that applies to this PR using "x". -->

- [ ] Bugfix
- [x] Feature
- [ ] Code style update (formatting, local variables)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [ ] CI related changes
- [ ] Documentation content changes
- [ ] clarity.design website / infrastructure changes
- [ ] Other... Please describe:

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->

Issue Number: #278

## What is the new behavior?
`--box-shadow`, `--icon-visibility`, and `--icon-margin` CSS custom
properties added to cds-accordion-header.

## Does this PR introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below. -->

## Other information
@williamernest
Copy link
Contributor

Resolved with #279

Copy link

github-actions bot commented Dec 5, 2023

Hi there 👋, this is an automated message. To help Clarity keep track of discussions, we automatically lock closed issues after 14 days. Please look for another open issue or open a new issue with updated details and reference this one as necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants