bootswatch
bootswatch copied to clipboard
Sketchy : invalid inner border radius on card
If you create a card and you add a background color to the header, you will see this :

code :
<div class="card">
<div class="card-header text-white bg-success">Sample text</div>
<div class="card-body"></div>
</div>
If you check the css rule that comes with the border-radius, you can see an error:
.card-header:first-child {
border-radius: calc(255px 25px 225px 25px/25px 225px 25px 255px - 2px) calc(255px 25px 225px 25px/25px 225px 25px 255px - 2px) 0 0;
}
This error is due to a bootstrap variable:
$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default;
To fix this we can override this variable in sketchy/_variables.scss with
$card-inner-border-radius: 0 !default;
and add a custom border radius to sketchy/_bootswatch.scss :
.card {
border-radius: 5px 5px 5px 5px/25px 25px 25px 5px;
&-outline {
&-primary,
&-success,
&-info,
&-warning,
&-danger {
border-width: 2px;
}
}
&-header {
border-bottom-width: 2px;
border-color: inherit;
// add this rule
&:first-child {
border-radius: 3px 3px 0 0/23px 23px 0 0;
}
}
&-footer {
border-top-width: 2px;
}
}
This fix the problem :

However, two css rules are generated and I didn't found a way to fix it.

Hey @adraax, thanks for the detailed report. I'll push a fix for this shortly.