blob: 1f6c79f3d596b39867d9da88dc34387e8288b2a5 [file] [log] [blame]
// Copyright (C) 2023 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
@import "theme";
// Select field styled to look similar to a text input with a thin underline.
// Inspired by matherial design.
.pf-select {
font-family: $pf-font;
font-size: inherit;
outline: none; // Disable the default outline
border: none; // Disable the default border
border-bottom: solid 1px $pf-minimal-foreground; // Thin underline
background: none;
transition:
border $pf-anim-timing,
box-shadow $pf-anim-timing,
background $pf-anim-timing;
// Round only the top corners to avoid rounding the edges of the underline
border-radius: $pf-border-radius $pf-border-radius 0 0;
cursor: pointer;
// Very opinionated min width for a select input
// ... any smaller and it stops looking like a select input!
min-width: 80px;
& > .material-icons {
font-size: inherit;
line-height: inherit;
float: left;
}
&:hover {
background: $pf-minimal-background-hover;
}
&:focus {
background: $pf-minimal-background-hover;
border-bottom: solid 1px $pf-primary-background;
// The box-shadow thickens the bottom border, without adding to the height.
// This is the same technique used by materializecss:
// See https://materializecss.com/text-inputs.html
box-shadow: 0 1px 0 $pf-primary-background;
}
&[disabled] {
border-bottom-color: $pf-minimal-foreground-disabled;
color: $pf-minimal-foreground-disabled;
background: $pf-minimal-background-disabled;
cursor: not-allowed;
}
}