Skip to content

When setting both $input-focus-box-shadow and $input-box-shadow to none, Bootstrap generates invalid CSS. #41381

@morganwahl

Description

@morganwahl

Prerequisites

Describe the issue

If you set these Bootstrap Sass variables like so:

$input-focus-box-shadow: none;
$input-box-shadow: none;

You end up with this invalid CSS:

.form-control:focus {
  ...
  box-shadow: none, none;
}

This isn't a problem for the appearance of the page, but it would be nice to generate valid CSS, so that automated tools that look for invalid CSS aren't raising errors.

I see the box-shadow mixin does issue a warning when there are multiple box shadows and one of them is "none". Could it also have some logic to just output a single "none" when all the shadow values are "none"?

Reduced test cases

Include this before the Bootstrap variables.

$input-focus-box-shadow: none;
$input-box-shadow: none;
<input class="form-control"></input>

Put the focus in the input.

What operating system(s) are you seeing the problem on?

Linux

What browser(s) are you seeing the problem on?

No response

What version of Bootstrap are you using?

v5.3.1

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions