.grid-auto-fill-xs,
.grid-auto-fill-sm,
.grid-auto-fill-md {
    margin-left: calc(var(--grid-gutter-width-half) * -1);
    margin-right: calc(var(--grid-gutter-width-half) * -1);
    &:extend(.clearfix all);
    > div {
        float: left;
        position: relative;
        min-height: var(--1px);
        padding-left: var(--grid-gutter-width-half);
        padding-right: var(--grid-gutter-width-half);
    }
}

.grid-auto-fill-xs {
    > div {
         width: 20%;
    }
}
.grid-auto-fill-sm {
    > div {
        width: 25%;
    }
}
.grid-auto-fill-md {
    > div {
        width: 50%;
    }
}

@media screen and (max-width: @screen-sm-max) {
    .grid-auto-fill-xs {
        > div {
            width: 25%;
        }
    }
    .grid-auto-fill-sm {
        > div {
            width: 33.33333333333333%;
        }
    }
    .grid-auto-fill-md {
        > div {
            width: 50%;
        }
    }
}

@media screen and (max-width: @screen-xs-max) {
    .grid-auto-fill-xs {
        > div {
            width: 50%;
        }
    }
    .grid-auto-fill-sm,
    .grid-auto-fill-md {
        > div {
            width: 100%;
        }
    }
}

@supports (display: grid) {
    .grid-auto-fill-xxs,
    .grid-auto-fill-xs,
    .grid-auto-fill-sm,
    .grid-auto-fill-md {
        display: grid;
        grid-column-gap: var(--grid-gutter-width);
        margin-left: 0;
        margin-right: 0;
        > div {
            width: unset !important;
            padding-left: unset !important;
            padding-right: unset !important;
            min-height: unset !important;
            position: unset !important;
            float: unset !important;
        }
        &::before,
        &::after {
            display: none !important;
        }
    }

    .grid-auto-fill-xxs {
        grid-template-columns: repeat(auto-fill, minmax(var(--grid-column-width-xxsmall), 1fr));
    }
    .grid-auto-fill-xs {
        grid-template-columns: repeat(auto-fill, minmax(var(--grid-column-width-xsmall), 1fr));
    }
    .grid-auto-fill-sm {
        grid-template-columns: repeat(auto-fill, minmax(var(--grid-column-width-small), 1fr));
    }
    .grid-auto-fill-md {
        grid-template-columns: repeat(auto-fill, minmax(var(--grid-column-width-medium), 1fr));
    }

    .grid-auto-fit-xxs,
    .grid-auto-fit-xs,
    .grid-auto-fit-sm {
        display: grid;
        grid-column-gap: var(--grid-gutter-width);
    }

    .grid-auto-fit-xxs {
        grid-template-columns: repeat(auto-fit, minmax(var(--grid-column-width-xxsmall), 1fr));
    }
    .grid-auto-fit-xs {
        grid-template-columns: repeat(auto-fit, minmax(var(--grid-column-width-xsmall), 1fr));
    }
    .grid-auto-fit-sm {
        grid-template-columns: repeat(auto-fit, minmax(var(--grid-column-width-small), 1fr));
    }
}
