-
Notifications
You must be signed in to change notification settings - Fork 9
UDS-1970: feat(unity-bootstrap-theme): added mixin to expand clickable area #1564
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
base: dev
Are you sure you want to change the base?
Conversation
Storybook deployed at https://unity-uds-staging.s3.us-west-2.amazonaws.com/pr-1564/index.html |
position: absolute; | ||
min-width: $min-width; | ||
min-height: $min-height; | ||
z-index: -1; |
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.
Since we are using ::before
, the text will naturally have a higher z-index, since it comes after ::before
and we should not use z-index:-1 since this will push the ::before
content behind an element with position: relative and will prevent the clickable-area from working
inset: 0; | ||
margin: auto; | ||
} | ||
} |
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.

&::before {
content: "";
position: absolute;
min-width: $min-width; // is not needed, but doesn't hurt
min-height: $min-height;
// z-index: -1;
inset: 0;
margin: auto;
right: min(0px, calc(50% - #{$min-width} / 2));
left: min(0px, calc(50% - #{$min-width} / 2));
background-color: #f002; // visual testing only
}
The code above equally expands the clickable area in all directions, The only issue is the overlap with the 1 character buttons, but I think this is an extreme scenario
} | ||
|
||
// Extra styles that don't have bootstrap variables to override | ||
.btn { |
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.
&::before { | ||
content: ""; | ||
position: absolute; | ||
min-width: $min-width; |
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.
Hi @scott-williams-az @davidornelas11 |
Changes addressed
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.
Looks good and expands the click area
added mixin to expand clickable area for btn
UDS-1970
Description
Checklist
Important Reminders
Links