-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Simpler carousel indicators css #26996
Simpler carousel indicators css #26996
Conversation
I definitely like this, but better wait for one more approval. |
Ping @andresgalante @mdo |
scss/_carousel.scss
Outdated
margin-right: $carousel-indicator-spacer; | ||
margin-left: $carousel-indicator-spacer; | ||
text-indent: -999px; | ||
cursor: pointer; | ||
background-color: $carousel-indicator-active-bg; | ||
background-clip: padding-box; | ||
// Use transparent borders to increase the hit area by 10px on top and bottom. | ||
border-top: 10px solid transparent; |
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.
Can we move to a variable for the 10px
value, and then use that here, on L196 and L187?
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.
Changed it to a variable and used box-sizing: content-box
instead of adding the hit area height to indicator height (this makes it possible to define the hit area height in another unit).
Pseudo elements are used to increase the hit area by 10px on top and bottom, but this can also be done with transparent borders which saves a bit css.
Demo: https://codepen.io/MartijnCuppens/pen/ajNXZj