Skip to content

Using percentages in $container-max-widths #29815

@raky291

Description

@raky291

This issue is back #20123

I'm using Bootstrap 4.4.1

I'm trying to use percentages in $container-max-widths but throw in an error

SassError: Incompatible units: '%' and 'px'.
        on line 29 of node_modules/bootstrap/scss/_grid.scss, in mixin `@content`
        from line 62 of node_modules/bootstrap/scss/mixins/_breakpoints.scss, in mixin `media-breakpoint-up`
        from line 23 of node_modules/bootstrap/scss/_grid.scss
        from line 6 of client/styles/vendors/_bootstrap.scss
        from line 2 of XXX\client\styles\styles.scss
>>         @if ($container-max-width > $width or $breakpoint == $name) {

   -------------^

Sample code

// Grid containers

$container-max-widths: (
    sm: 90%,
    md: 90%,
    lg: 960px,
    xl: 1440px
);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions