1// Copyright 2024 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14
15import { css } from 'lit';
16
17export const styles = css`
18  :host {
19    align-items: center;
20    background-color: var(--sys-log-viewer-color-controls-bg);
21    border-bottom: 1px solid var(--md-sys-color-outline-variant);
22    box-sizing: border-box;
23    color: var(--sys-log-viewer-color-controls-text);
24    contain: style;
25    display: flex;
26    flex-shrink: 0;
27    gap: 1rem;
28    height: var(--sys-log-viewer-header-height);
29    justify-content: space-between;
30    padding: 0 1rem;
31    position: relative;
32    --md-list-item-leading-icon-size: 1.2rem;
33    --md-filled-text-field-container-shape: 32px;
34    --md-filled-text-field-container-color: var(--md-sys-color-surface);
35    --md-filled-text-field-hover-state-layer-color: var(
36      --md-sys-color-inverse-on-surface
37    );
38    --md-filled-text-field-input-text-size: 0.875rem;
39    --md-filled-text-field-input-text-line-height: 0.75;
40    --md-filled-text-field-top-space: 0.375rem;
41    --md-filled-text-field-bottom-space: 0.375rem;
42    --md-filled-text-field-active-indicator-color: transparent;
43    --md-filled-text-field-hover-active-indicator-color: transparent;
44    --md-filled-text-field-focus-active-indicator-color: transparent;
45    --md-filled-text-field-input-text-placeholder-color: var(
46      --md-sys-color-outline
47    );
48    --text-field-icon-size: 1.375rem;
49  }
50
51  :host > * {
52    display: flex;
53  }
54
55  :host *[hidden] {
56    display: none;
57  }
58
59  :host([searchexpanded]) .host-name {
60    display: none;
61  }
62
63  :host([searchexpanded]) .toolbar {
64    flex: 1 1 auto;
65  }
66
67  :host([searchexpanded]) md-filled-text-field {
68    width: 100%;
69  }
70
71  .host-name {
72    display: block;
73    flex: 0 1 auto;
74    font-size: var(--sys-log-viewer-header-title-font-size);
75    font-weight: 300;
76    margin: 0;
77    max-width: 30rem;
78    overflow: hidden;
79    text-overflow: ellipsis;
80    white-space: nowrap;
81  }
82
83  .toolbar {
84    align-items: center;
85    flex: 1 0 auto;
86    gap: 0.5rem;
87    justify-content: flex-end;
88  }
89
90  .actions-container {
91    --md-icon-button-icon-size: 1.375rem;
92    flex: 0 0 auto;
93    position: relative;
94  }
95
96  .col-toggle-menu {
97    --md-checkbox-state-layer-size: 0;
98  }
99
100  .col-toggle-menu md-checkbox,
101  .col-toggle-menu label {
102    pointer-events: none;
103  }
104
105  .col-toggle-menu label {
106    display: flex;
107    gap: 0.75rem;
108    align-items: center;
109  }
110
111  md-filled-text-field {
112    --md-icon-button-icon-size: var(--text-field-icon-size);
113    --md-icon-button-icon-color: var(--md-sys-color-outline);
114    --md-icon-button-state-layer-height: calc(
115      var(--text-field-icon-size) + 0.5rem
116    );
117    --md-icon-button-state-layer-width: calc(
118      var(--text-field-icon-size) + 0.5rem
119    );
120    width: 25rem;
121  }
122
123  .field-buttons {
124    padding-right: 0.5rem;
125  }
126
127  .field-buttons md-icon-button[hidden] {
128    display: block;
129    visibility: hidden;
130  }
131`;
132