|
4 | 4 | * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
5 | 5 | */
|
6 | 6 | @media lumo_components_split-layout {
|
7 |
| - :host { |
8 |
| - display: flex; |
9 |
| - overflow: hidden !important; |
10 |
| - } |
11 |
| - |
12 |
| - :host([hidden]) { |
13 |
| - display: none !important; |
14 |
| - } |
15 |
| - |
16 |
| - :host([orientation='vertical']) { |
17 |
| - flex-direction: column; |
18 |
| - } |
19 |
| - |
20 |
| - :host ::slotted(*) { |
21 |
| - flex: 1 1 auto; |
22 |
| - overflow: auto; |
23 |
| - } |
24 |
| - |
25 | 7 | [part='splitter'] {
|
26 |
| - flex: none; |
27 |
| - position: relative; |
28 |
| - z-index: 1; |
29 |
| - overflow: visible; |
30 |
| - min-width: var(--lumo-space-s); |
31 |
| - min-height: var(--lumo-space-s); |
32 |
| - background-color: var(--lumo-contrast-5pct); |
| 8 | + --_splitter-size: var(--vaadin-split-layout-splitter-size, var(--lumo-space-s)); |
| 9 | + --_splitter-target-size: var(--vaadin-split-layout-splitter-target-size, var(--lumo-space-s)); |
| 10 | + --_handle-size: var(--vaadin-split-layout-handle-size, var(--lumo-space-xs)); |
| 11 | + --_handle-target-size: var(--vaadin-split-layout-handle-target-size, var(--lumo-size-m)); |
| 12 | + background: var(--vaadin-split-layout-splitter-background, var(--lumo-contrast-5pct)); |
33 | 13 | transition: 0.1s background-color;
|
34 | 14 | }
|
35 | 15 |
|
36 |
| - :host(:not([orientation='vertical'])) > [part='splitter'] { |
37 |
| - cursor: ew-resize; |
38 |
| - } |
39 |
| - |
40 |
| - :host([orientation='vertical']) > [part='splitter'] { |
41 |
| - cursor: ns-resize; |
42 |
| - } |
43 |
| - |
44 | 16 | [part='handle'] {
|
45 |
| - position: absolute; |
46 |
| - top: 50%; |
47 |
| - left: 50%; |
48 |
| - transform: translate3d(-50%, -50%, 0); |
49 |
| - display: flex; |
50 |
| - align-items: center; |
51 |
| - justify-content: center; |
52 |
| - width: var(--lumo-size-m); |
53 |
| - height: var(--lumo-size-m); |
54 |
| - } |
55 |
| - |
56 |
| - [part='handle']::after { |
57 |
| - content: ''; |
58 |
| - display: block; |
59 |
| - --_handle-size: 4px; |
60 |
| - width: var(--_handle-size); |
61 |
| - height: 100%; |
62 |
| - max-width: 100%; |
63 |
| - max-height: 100%; |
| 17 | + background: var(--vaadin-split-layout-handle-background, var(--lumo-contrast-30pct)); |
64 | 18 | border-radius: var(--lumo-border-radius-s);
|
65 |
| - background-color: var(--lumo-contrast-30pct); |
66 |
| - transition: |
67 |
| - 0.1s opacity, |
68 |
| - 0.1s background-color; |
69 |
| - } |
70 |
| - |
71 |
| - :host([orientation='vertical']) [part='handle']::after { |
72 |
| - width: 100%; |
73 |
| - height: var(--_handle-size); |
74 | 19 | }
|
75 | 20 |
|
76 | 21 | /* Active style */
|
77 |
| - [part='splitter']:active [part='handle']::after { |
78 |
| - background-color: var(--lumo-contrast-50pct); |
| 22 | + [part='splitter']:active [part='handle'] { |
| 23 | + background: var(--lumo-contrast-50pct); |
79 | 24 | }
|
80 | 25 |
|
81 |
| - /* Small/minimal */ |
| 26 | + /* Small overrides */ |
82 | 27 | :host([theme~='small']) > [part='splitter'] {
|
83 |
| - border-left: 1px solid var(--lumo-contrast-10pct); |
84 |
| - border-top: 1px solid var(--lumo-contrast-10pct); |
85 |
| - } |
86 |
| - |
87 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter'] { |
88 |
| - min-width: 0; |
89 |
| - min-height: 0; |
90 |
| - background-color: transparent; |
91 |
| - } |
92 |
| - |
93 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter']::after { |
94 |
| - content: ''; |
95 |
| - position: absolute; |
96 |
| - inset: -4px; |
| 28 | + --vaadin-split-layout-handle-size: 5px; |
| 29 | + background: var(--lumo-contrast-10pct); |
97 | 30 | }
|
98 | 31 |
|
99 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter'] > [part='handle'] { |
100 |
| - left: calc(50% - 0.5px); |
101 |
| - top: calc(50% - 0.5px); |
| 32 | + /* Minimal */ |
| 33 | + :host([theme~='minimal']) > [part='splitter'] { |
| 34 | + --vaadin-split-layout-splitter-size: 0px; |
| 35 | + --vaadin-split-layout-handle-size: 5px; |
| 36 | + --vaadin-split-layout-splitter-target-size: 5px; |
102 | 37 | }
|
103 | 38 |
|
104 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter'] > [part='handle']::after { |
| 39 | + :host([theme~='minimal']) > [part='splitter'] > [part='handle'] { |
105 | 40 | opacity: 0;
|
106 |
| - --_handle-size: 5px; |
107 | 41 | }
|
108 | 42 |
|
109 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter']:hover > [part='handle']::after, |
110 |
| - :host(:is([theme~='small'], [theme~='minimal'])) > [part='splitter']:active > [part='handle']::after { |
| 43 | + :host([theme~='minimal']) > [part='splitter']:is(:hover, :active) > [part='handle'] { |
111 | 44 | opacity: 1;
|
112 | 45 | }
|
113 | 46 |
|
114 | 47 | /* Hover style */
|
115 | 48 | @media (any-hover: hover) {
|
116 |
| - [part='splitter']:hover [part='handle']::after { |
| 49 | + [part='splitter']:hover [part='handle'] { |
117 | 50 | background-color: var(--lumo-contrast-40pct);
|
118 | 51 | }
|
119 | 52 | }
|
120 |
| - |
121 |
| - @media (forced-colors: active) { |
122 |
| - [part~='splitter'] { |
123 |
| - outline: 1px solid; |
124 |
| - } |
125 |
| - |
126 |
| - [part~='handle']::after { |
127 |
| - background-color: AccentColor !important; |
128 |
| - forced-color-adjust: none; |
129 |
| - } |
130 |
| - } |
131 | 53 | }
|
0 commit comments