Skip to content

Story 2158: Banner Component#2181

Open
jlchilders11 wants to merge 4 commits intov3from
jc/2158-banner-component
Open

Story 2158: Banner Component#2181
jlchilders11 wants to merge 4 commits intov3from
jc/2158-banner-component

Conversation

@jlchilders11
Copy link
Collaborator

Light mode:
image

Dark Mode:
image

Mobile:
image

Closes #2158

Copy link
Collaborator

Choose a reason for hiding this comment

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

@jlchilders11 On a second thought, I think there's actually a way to do the fading animation using just CSS with transition-delay. Given our preference with having minimal JS, would you mind trying the pure CSS approach instead to see if it's possible?

Secondly, should we consider using display: none instead of opacity 🤔? With opacity, after the animation is done, users will just see an empty space, which can look like inconsistent UI. Maybe this is a design question that is worth double-checking with Henry!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@julhoang While we can do a transition-delay to achieve a lot of the same effects, we would need a separate class for each possible delay time. If that is what we want I can do that, it would require limiting the options for delay time.

Re: display none vs opacity, this isn't animatable, but I have converted this to use a css transition instead which can handle display. I agree this is cleaner.

Copy link
Collaborator

Choose a reason for hiding this comment

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

While we can do a transition-delay to achieve a lot of the same effects, we would need a separate class for each possible delay time.

I wonder if we can pass them as inline-style: so like

<div class="banner" role="alert" {% if fade_time %}data-fade style="--fade-delay: {{fade_time}}ms;"{% endif %}>

What do you think of this approach?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Is there a way to toggle a transition without user input or javascript? This is somewhat on the edge of my expertise, is there a pseudo class for rendered?

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