-
Notifications
You must be signed in to change notification settings - Fork 51
Extend the "Button" component to support also links as actions (02) #220
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
Changes from 29 commits
e2cbe81
393f330
6b8441a
0c87f75
011de8d
abd2aac
cf58529
9e68782
81d5878
25223ec
821a86b
1cdd811
cf71762
b0bc06f
934a3d5
29f79fe
e104fbf
c812e39
c8106a9
8faea6c
dba115f
3a86700
0a963a4
18d5662
4e13bcf
84388c5
f65348b
5571f30
cc4dcd7
07dd76e
e59543b
1969434
de89138
2535a1d
228e891
2836b6f
e782b79
00573b5
54ef3b7
ccf9988
885e398
237e1cb
dff380e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,6 +26,11 @@ $hds-button-focus-border-width: 3px; | |
| position: relative; | ||
| width: auto; | ||
|
|
||
| // the <a> element behaves differently than a <button> | ||
| @at-root a#{&} { | ||
| width: fit-content; | ||
| } | ||
|
|
||
| // This covers all of the browsers and focus scenarios (due to the custom focus design). | ||
| &:disabled, | ||
| &[disabled], | ||
|
|
@@ -304,4 +309,24 @@ $size-props: ( | |
| border-color: transparent; | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // SPECIAL | ||
|
|
||
| // we apply a visual treatment to alert the developer if a "href" HTML attribute is used (instead of the "@href" Ember argument) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please let me know what you think of this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like a good idea; if we end-up needing this in other places there may be value in converting it into a mixin |
||
|
|
||
| button.hds-button[href] { | ||
| background-color: red !important; | ||
| color: white !important; | ||
| border: none; | ||
|
|
||
| .hds-button__text, | ||
| &::before { | ||
| display: none; | ||
| } | ||
|
|
||
| &::after { | ||
| content: ' Attention: youโre passing a "href" attribute to the "Hds::Button" component, you should use an "@href" argument.'; | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
I've removed the
@typeargument from the API in favour of thetypenative attribute (this simplifies the code)Notice: by default
type="button"(seeHds::Interactivecode)