Add explicit icon and label support for button CSS components.
Review Request #13289 — Created Sept. 26, 2023 and submitted
This updates
rb-c-button
to include__icon
and__label
parts for
defining buttons containing both icons and labels in a consistent
manner. This will be styled with an appropriate gap in-between the two,
when both are present and visible.Buttons now use flexbox for layout to enable this, and to ensure that
everything lines up correctly.There are two new macros for customizing icons:
-
#rb-ns-ui.buttons.set-icon-only()
will hide the label on a button
and update the padding so the button looks correct with just an icon. -
#rb-ns-ui.buttons.set-fa-icon()
takes a FontAwesome icon variable
and set it on the__icon
part.
Tested with existing buttons, button groups, and menu buttons throughout
the UI.Tested with some in-progress icon-only and icon-enabled buttons.
Summary | ID |
---|---|
1c3c1a04c049e41f7abc654f065d481887a8bc0f |
- Change Summary:
-
- Added the missing
set-fa-icon()
(it was unstaged for commit). - Documented that
__icon
should havearia-hidden="true"
. - Moved
__icon
and__label
definitions out of.rb-c-button
in order to avoid&:extend
below causing them to be dropped.
- Added the missing
- Commits:
-
Summary ID 57570235579fbecf3ba1f95c1368e88332c56315 1c3c1a04c049e41f7abc654f065d481887a8bc0f - Diff:
-
Revision 2 (+246 -4)