Elizabeth Mitchell fd605d537c feat(field): add resizability
PiperOrigin-RevId: 512747965
2023-02-27 15:27:57 -08:00

66 lines
1.6 KiB
SCSS

//
// Copyright 2021 Google LLC
// SPDX-License-Identifier: Apache-2.0
//
// go/keep-sorted start
@use 'sass:map';
// go/keep-sorted end
// go/keep-sorted start
@use './content';
@use './label';
@use './supporting-text';
// go/keep-sorted end
@mixin styles() {
:host {
display: inline-flex;
}
.field {
display: flex;
flex: 1;
flex-direction: column;
// Allow the use of block/inline reflexive RTL properties without impacting
// structure when languages change.
writing-mode: horizontal-tb;
max-width: 100%; // Do not allow field to grow beyond explicitly set width
}
// A separate wrapper is needed around the container for the outline, whose
// floating label needs overflow: visible. The container itself needs
// overflow: hidden for resizability.
.container-overflow {
border-start-start-radius: var(--_container-shape-start-start);
border-start-end-radius: var(--_container-shape-start-end);
border-end-end-radius: var(--_container-shape-end-end);
border-end-start-radius: var(--_container-shape-end-start);
display: flex;
position: relative;
}
.container {
align-items: center;
border-radius: inherit;
display: flex;
flex: 1;
min-width: min-content;
overflow: hidden;
padding-top: var(--_container-padding-vertical);
padding-bottom: var(--_container-padding-vertical);
position: relative;
}
.resizable .container {
resize: both;
}
.disabled {
pointer-events: none;
}
@include content.styles;
@include label.styles;
@include supporting-text.styles;
}