-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
fix(link): exclude button elements from no-href styling #4709
fix(link): exclude button elements from no-href styling #4709
Conversation
Deploy preview for the-carbon-components ready! Built with commit 8027d08 https://deploy-preview-4709--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 8027d08 https://deploy-preview-4709--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 8027d08 |
Deploy preview for carbon-elements ready! Built with commit 76a50d5 |
Deploy preview for carbon-components-react ready! Built with commit 76a50d5 https://deploy-preview-4709--carbon-components-react.netlify.com |
Deploy preview for the-carbon-components ready! Built with commit 76a50d5 https://deploy-preview-4709--the-carbon-components.netlify.com |
@carbon-design-system/design Do we allow a breadcrumb item being a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should link visual styles be contained in a separate mixin instead? then rather than applying .bx--link
to all breadcrumb items, we can modify the breadcrumb stylesheet to include the link styles mixin (which would not include styles based on href
) on a class like .bx--breadcrumb-link
or something instead
Thanks @emyarod! I can definitely see that being an effective approach. With the Another thing -- until now, the component has had any child of |
Addresses issue raised in this comment: #4705 (comment)
There are situations, like with
BreadcrumbItem
, wherebx--link
class is added to an element.If the child of
BreadcrumbItem
is a button, for example, then that button will getbx--link
applied to it, and since the button won't have anhref
, it will get:disabled
styling, including no pointer events. But that's problematic, as shown in #4705 (comment), because:disabled
styling is being applied to an interactive button.This PR proposes a small fix to exclude buttons from this
bx--link:not([href])
rule block.Changelog
Changed
bx--link:not([href])
stylingTesting / Reviewing
A couple ways to test this...
Button
child to aBreadcrumbItem
& see that it no longer hasdisabled
styling and no pointer eventsbx--link
class to aButton
component in the React storybook deployment for this PR (make sure you are adding the class to abutton
element)