Skip to content

Styling <select> by changing less variables in Luma theme doesn't work as expected #15608

Closed
@denistrator

Description

@denistrator

Preconditions

  1. FE theme inherited from Luma

Steps to reproduce

  1. In Custom/theme/web/css/source/_theme.less set less variables:
    @select__background: rgba(255, 255, 255, 0.15);
    @select__border: 2px dashed blue;
    @select__height: 50px;
    @select__padding: 15px 40px 15px 15px;
    @select__background-clip: border-box;
  2. Compile less

Expected result

Have "select" elements with the styles you set in _theme.less

Actual result

"select" elements have different styles

What causes the issue

web/css/source/_forms.less overrides some "select" styles defined with "@select__" variables
screenshot_287

Solution

Remove styles for background, border, height, padding-right from web/css/source/_forms.less and set these styles in _theme.less

Metadata

Metadata

Labels

Fixed in 2.1.xThe issue has been fixed in 2.1 release lineFixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Format is validGate 1 Passed. Automatic verification of issue format passed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions