]>
Commit | Line | Data |
---|---|---|
8cbc40b2 C |
1 | @use 'sass:math'; |
2 | @use '_variables' as *; | |
3 | @use '_mixins' as *; | |
66b16caf | 4 | |
b15fe00f K |
5 | $nav-preview-tab-height: 30px; |
6 | $base-padding: 15px; | |
b15fe00f K |
7 | $input-border-radius: 3px; |
8 | ||
9 | @mixin in-small-view { | |
10 | .root { | |
11 | display: flex; | |
12 | flex-direction: column; | |
13 | ||
14 | textarea { | |
15 | @include peertube-textarea(100%, 150px); | |
16 | ||
e66883b3 | 17 | background-color: pvar(--markdownTextareaBackgroundColor); |
f33dc6ab | 18 | |
c2a89b70 | 19 | font-family: monospace; |
b15fe00f | 20 | font-size: 13px; |
931d3430 | 21 | border-bottom: 0; |
b15fe00f K |
22 | border-bottom-left-radius: unset; |
23 | border-bottom-right-radius: unset; | |
24 | } | |
a077482f | 25 | |
b15fe00f | 26 | .nav-preview { |
27bc9586 C |
27 | @include padding-left(10px); |
28 | @include padding-right(10px); | |
29 | ||
b15fe00f | 30 | display: block; |
27bc9586 | 31 | text-align: end; |
b15fe00f K |
32 | padding-top: 10px; |
33 | padding-bottom: 10px; | |
b15fe00f K |
34 | border-top: 1px dashed $input-border-color; |
35 | border-left: 1px solid $input-border-color; | |
36 | border-right: 1px solid $input-border-color; | |
37 | border-bottom: 1px solid $input-border-color; | |
38 | border-bottom-right-radius: $input-border-radius; | |
66b16caf | 39 | |
b15fe00f K |
40 | border-bottom-left-radius: $input-border-radius; |
41 | ::ng-deep { | |
42 | .nav-link { | |
43 | display: none !important; | |
44 | } | |
45 | ||
01d0147e | 46 | .maximize-button { |
47 | padding: 0 7px; | |
48 | cursor: pointer; | |
49 | ||
50 | svg { | |
51 | stroke: var(--mainForegroundColor); | |
52 | opacity: 0.6; | |
53 | } | |
54 | ||
931d3430 C |
55 | &:hover, |
56 | &:active { | |
01d0147e | 57 | svg { |
58 | opacity: 1; | |
59 | } | |
60 | } | |
b15fe00f K |
61 | } |
62 | } | |
63 | } | |
64 | ||
65 | ::ng-deep { | |
66 | .tab-content { | |
67 | display: none; | |
68 | } | |
69 | } | |
66b16caf | 70 | } |
b15fe00f K |
71 | } |
72 | ||
73 | @mixin nav-preview-medium { | |
74 | display: flex; | |
75 | flex-grow: 1; | |
76 | border-bottom-left-radius: unset; | |
77 | border-bottom-right-radius: unset; | |
e66883b3 | 78 | border-bottom: 2px solid pvar(--mainColor); |
66b16caf | 79 | |
b15fe00f | 80 | :first-child { |
27bc9586 | 81 | @include margin-left(auto); |
a077482f C |
82 | } |
83 | ||
03652b31 | 84 | ::ng-deep { |
66b16caf C |
85 | .nav-link { |
86 | display: flex !important; | |
87 | align-items: center; | |
b15fe00f | 88 | height: $nav-preview-tab-height !important; |
66b16caf | 89 | padding: 0 15px !important; |
482fa503 RK |
90 | font-size: 85% !important; |
91 | opacity: .7; | |
66b16caf C |
92 | } |
93 | ||
01d0147e | 94 | .maximize-button { |
27bc9586 | 95 | @include margin-left(5px); |
b15fe00f K |
96 | } |
97 | } | |
98 | } | |
99 | ||
100 | @mixin content-preview-base { | |
101 | display: block; | |
102 | min-height: 75px; | |
103 | padding: $base-padding; | |
104 | overflow-y: auto; | |
105 | font-size: 15px; | |
106 | word-wrap: break-word; | |
107 | } | |
108 | ||
109 | @mixin maximized-base { | |
931d3430 C |
110 | $nav-preview-vertical-padding: 40px; |
111 | ||
b15fe00f K |
112 | flex-direction: row; |
113 | z-index: #{z(header) - 1}; | |
114 | position: fixed; | |
115 | top: $header-height; | |
116 | left: $menu-width; | |
117 | max-height: none !important; | |
118 | max-width: none !important; | |
119 | width: calc(100% - #{$menu-width}); | |
120 | height: calc(100vh - #{$header-height}) !important; | |
121 | ||
b15fe00f K |
122 | .nav-preview { |
123 | @include nav-preview-medium(); | |
27bc9586 C |
124 | @include padding-right(0); |
125 | @include padding-left(0); | |
126 | ||
8cbc40b2 C |
127 | padding-top: math.div($nav-preview-vertical-padding, 2); |
128 | padding-bottom: math.div($nav-preview-vertical-padding, 2); | |
b15fe00f | 129 | position: absolute; |
e66883b3 | 130 | background-color: pvar(--mainBackgroundColor); |
b15fe00f | 131 | width: 100% !important; |
931d3430 C |
132 | border-top: 0; |
133 | border-left: 0; | |
134 | border-right: 0; | |
b15fe00f K |
135 | |
136 | :last-child { | |
27bc9586 | 137 | @include margin-right(pvar(--horizontalMarginContent)); |
b15fe00f K |
138 | } |
139 | } | |
140 | ||
141 | ::ng-deep .tab-content { | |
142 | @include content-preview-base(); | |
e66883b3 RK |
143 | background-color: pvar(--mainBackgroundColor); |
144 | scrollbar-color: pvar(--actionButtonColor) pvar(--mainBackgroundColor); | |
b15fe00f K |
145 | } |
146 | ||
147 | textarea, | |
148 | ::ng-deep .tab-content { | |
149 | max-height: none !important; | |
150 | max-width: none !important; | |
151 | margin-top: #{$nav-preview-tab-height + $nav-preview-vertical-padding} !important; | |
152 | height: calc(100vh - #{$header-height + $nav-preview-tab-height + $nav-preview-vertical-padding}) !important; | |
153 | width: 50% !important; | |
931d3430 | 154 | border: 0 !important; |
b15fe00f K |
155 | border-radius: unset !important; |
156 | } | |
157 | ||
158 | :host-context(.expanded) { | |
159 | .root.maximized { | |
160 | left: 0; | |
161 | width: 100%; | |
162 | } | |
163 | } | |
164 | } | |
165 | ||
166 | @mixin maximized-in-small-view { | |
167 | .root.maximized { | |
168 | @include maximized-base(); | |
169 | ||
170 | textarea { | |
171 | display: none; | |
66b16caf | 172 | } |
b15fe00f K |
173 | |
174 | ::ng-deep .tab-content { | |
175 | width: 100% !important; | |
176 | } | |
177 | } | |
178 | } | |
179 | ||
180 | @mixin maximized-tabs-in-mobile-view { | |
181 | // Ellipsis on tabs for mobile view | |
182 | .root.maximized { | |
183 | .nav-preview { | |
184 | ::ng-deep .nav-link { | |
185 | @include ellipsis(); | |
27bc9586 | 186 | @include margin-right(10px !important); |
b15fe00f K |
187 | |
188 | display: block !important; | |
189 | max-width: 45% !important; | |
190 | padding: 5px 0 !important; | |
b15fe00f K |
191 | text-align: center; |
192 | ||
193 | &:not(.active) { | |
194 | max-width: 15% !important; | |
195 | } | |
196 | ||
197 | &.active { | |
198 | padding: 5px 15px !important; | |
199 | } | |
200 | } | |
201 | } | |
202 | } | |
203 | } | |
204 | ||
205 | @mixin in-medium-view { | |
206 | .root { | |
207 | .nav-preview { | |
208 | @include nav-preview-medium(); | |
209 | } | |
210 | ||
211 | ::ng-deep .tab-content { | |
212 | @include content-preview-base(); | |
213 | max-height: 210px; | |
214 | border-bottom: 1px solid $input-border-color; | |
215 | border-left: 1px solid $input-border-color; | |
216 | border-right: 1px solid $input-border-color; | |
217 | border-bottom-left-radius: $input-border-radius; | |
218 | border-bottom-right-radius: $input-border-radius; | |
219 | } | |
220 | } | |
221 | } | |
222 | ||
223 | @mixin maximized-in-medium-view { | |
224 | .root.maximized { | |
225 | @include maximized-base(); | |
226 | ||
227 | textarea { | |
228 | display: block; | |
229 | padding: $base-padding; | |
230 | border-right: 1px dashed $input-border-color !important; | |
231 | resize: none; | |
e66883b3 | 232 | scrollbar-color: pvar(--actionButtonColor) pvar(--markdownTextareaBackgroundColor); |
b15fe00f K |
233 | |
234 | &:focus { | |
235 | box-shadow: none; | |
236 | } | |
237 | } | |
238 | } | |
239 | } | |
240 | ||
241 | @include in-small-view(); | |
242 | @include maximized-in-small-view(); | |
243 | ||
244 | @media only screen and (max-width: $mobile-view) { | |
245 | @include maximized-tabs-in-mobile-view(); | |
246 | } | |
247 | ||
248 | @media only screen and (max-width: #{$mobile-view + $menu-width}) { | |
249 | :host-context(.main-col:not(.expanded)) { | |
250 | @include maximized-tabs-in-mobile-view(); | |
251 | } | |
252 | } | |
253 | ||
254 | @media only screen and (min-width: $small-view) { | |
931d3430 C |
255 | @include maximized-in-medium-view(); |
256 | ||
b15fe00f K |
257 | :host-context(.expanded) { |
258 | @include in-medium-view(); | |
259 | } | |
b15fe00f K |
260 | } |
261 | ||
262 | @media only screen and (min-width: #{$small-view + $menu-width}) { | |
263 | :host-context(.main-col:not(.expanded)) { | |
264 | @include in-medium-view(); | |
66b16caf C |
265 | } |
266 | } |