bootstrap-less-port
Version:
A Less port of Bootstrap v4
112 lines (102 loc) • 2.54 kB
text/less
// Single side border-radius
#border-radius(@radius: @border-radius, @fallback-border-radius: false) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-radius: @radius;
}
}
& when not (@enable-rounded) and not (@fallback-border-radius = false) {
border-radius: @fallback-border-radius;
}
}
#border-top-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-top-left-radius: max(0, @radius);
border-top-right-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-top-left-radius: @radius;
border-top-right-radius: @radius;
}
}
}
#border-right-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-top-right-radius: max(0, @radius);
border-bottom-right-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-top-right-radius: @radius;
border-bottom-right-radius: @radius;
}
}
}
#border-bottom-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-bottom-right-radius: max(0, @radius);
border-bottom-left-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-bottom-right-radius: @radius;
border-bottom-left-radius: @radius;
}
}
}
#border-left-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-top-left-radius: max(0, @radius);
border-bottom-left-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-top-left-radius: @radius;
border-bottom-left-radius: @radius;
}
}
}
#border-top-left-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-top-left-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-top-left-radius: @radius;
}
}
}
#border-top-right-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-top-right-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-top-right-radius: @radius;
}
}
}
#border-bottom-right-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-bottom-right-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-bottom-right-radius: @radius;
}
}
}
#border-bottom-left-radius(@radius) {
& when (@enable-rounded) {
& when (isnumber(@radius)) {
border-bottom-left-radius: max(0, @radius);
}
& when not (isnumber(@radius)) {
border-bottom-left-radius: @radius;
}
}
}