bcgov / design-system

The B.C. Design System helps public sector design and development teams build consistent, accessible products
https://gov.bc.ca/designsystem
Apache License 2.0
56 stars 38 forks source link

InlineAlert close button is removed from document flow to center alert text vertically #449

Closed ty2k closed 1 month ago

ty2k commented 1 month ago

Marking this as a draft so we can discuss whether we prefer to go this route or to make a smaller version of Button. See #444.

This PR updates the InlineAlert to remove the close button from the document flow, positioning it with position: absolute and a negative top value to center it.

The advantage of this approach is that we retain the 32px x 32px click target size for the close button, rather than rolling a smaller button. The disadvantage is that the code is more hacky and less declarative than using a smaller button and keeping the current InlineAlert code.

Single line of text, before and after:

Single line, before Single line, after

Multiple lines of text, before and after:

Multi line, before Multi line, after
ty2k commented 1 month ago

Marking this as ready for review after our team discussion. Let's go forward with this plan for now.