| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- // 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;
- }
- }
- }
|