Add an official alert/flash component #40
Replies: 2 comments
-
Yeah, I would like to have an alert type role in place for PicoCSS. I'm completely open for a pull request as long as we're following the guidelines in the docs above to some degree. The codepen definitely has a good starting point to work off of, we should use the v2 variables instead of creating more that have the same values. For the green and red colors, I'd like to use the del and ins colors, for both dark and light modes. Not sure about a warning or info colors, we'll have to investigate what color codes are used within the pico colors. This would also be good to work as a classless alert, so a default alert color scheme without classes, and then for more robust alert we could add the classes. Maybe there's an aria attribute that can be used instead of classes for the different type of alerts. From the docs:
|
Beta Was this translation helpful? Give feedback.
-
Something like the following for a default, classless alert may work. [role="alert"] {
background-color: var(--pico-primary-focus);
display: block;
padding: calc(var(--pico-spacing) * 0.5);
margin-block-start: calc(var(--pico-spacing) * 0.5);
border-radius: var(--pico-border-radius);
border: var(--pico-border-width) solid var(--pico-primary);
color: var(--pico-primary-inverse);
} |
Beta Was this translation helpful? Give feedback.
-
Currently, there is no alert/flash component working out of the box.
An experiment was made with
v1.x
on this Codepen but it does not work anymore withv2.x
.Here is the original issue on the main repo asking for alert/flash: picocss#12
What do you think about this new component ?
Beta Was this translation helpful? Give feedback.
All reactions