Skip to content

Simpler carousel indicators css#26996

Merged
XhmikosR merged 8 commits intotwbs:v4-devfrom
MartijnCuppens:carousel-indicator-cleanup
Aug 26, 2018
Merged

Simpler carousel indicators css#26996
XhmikosR merged 8 commits intotwbs:v4-devfrom
MartijnCuppens:carousel-indicator-cleanup

Conversation

@MartijnCuppens
Copy link
Copy Markdown
Member

@MartijnCuppens MartijnCuppens commented Jul 30, 2018

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

@XhmikosR
Copy link
Copy Markdown
Member

XhmikosR commented Aug 2, 2018

I definitely like this, but better wait for one more approval.

@XhmikosR
Copy link
Copy Markdown
Member

Ping @andresgalante @mdo

Comment thread scss/_carousel.scss Outdated
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;
Copy link
Copy Markdown
Member

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?

Copy link
Copy Markdown
Member Author

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).

@XhmikosR XhmikosR merged commit 0e88315 into twbs:v4-dev Aug 26, 2018
@mdo mdo mentioned this pull request Aug 26, 2018
@MartijnCuppens MartijnCuppens deleted the carousel-indicator-cleanup branch August 26, 2018 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants