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