]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/shared/shared-forms/markdown-textarea.component.scss
Fix top menu opacity
[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;
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);
3d2078d6 52 opacity: 0.7;
01d0147e 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;
b15fe00f
K
105 word-wrap: break-word;
106}
107
108@mixin maximized-base {
931d3430
C
109 $nav-preview-vertical-padding: 40px;
110
b15fe00f
K
111 flex-direction: row;
112 z-index: #{z(header) - 1};
113 position: fixed;
114 top: $header-height;
115 left: $menu-width;
116 max-height: none !important;
117 max-width: none !important;
118 width: calc(100% - #{$menu-width});
119 height: calc(100vh - #{$header-height}) !important;
120
b15fe00f
K
121 .nav-preview {
122 @include nav-preview-medium();
27bc9586
C
123 @include padding-right(0);
124 @include padding-left(0);
125
8cbc40b2
C
126 padding-top: math.div($nav-preview-vertical-padding, 2);
127 padding-bottom: math.div($nav-preview-vertical-padding, 2);
b15fe00f 128 position: absolute;
e66883b3 129 background-color: pvar(--mainBackgroundColor);
b15fe00f 130 width: 100% !important;
931d3430
C
131 border-top: 0;
132 border-left: 0;
133 border-right: 0;
b15fe00f
K
134
135 :last-child {
27bc9586 136 @include margin-right(pvar(--horizontalMarginContent));
b15fe00f
K
137 }
138 }
139
140 ::ng-deep .tab-content {
141 @include content-preview-base();
e66883b3
RK
142 background-color: pvar(--mainBackgroundColor);
143 scrollbar-color: pvar(--actionButtonColor) pvar(--mainBackgroundColor);
b15fe00f
K
144 }
145
146 textarea,
147 ::ng-deep .tab-content {
148 max-height: none !important;
149 max-width: none !important;
150 margin-top: #{$nav-preview-tab-height + $nav-preview-vertical-padding} !important;
151 height: calc(100vh - #{$header-height + $nav-preview-tab-height + $nav-preview-vertical-padding}) !important;
152 width: 50% !important;
931d3430 153 border: 0 !important;
b15fe00f
K
154 border-radius: unset !important;
155 }
156
157 :host-context(.expanded) {
158 .root.maximized {
159 left: 0;
160 width: 100%;
161 }
162 }
163}
164
165@mixin maximized-in-small-view {
166 .root.maximized {
167 @include maximized-base();
168
169 textarea {
170 display: none;
66b16caf 171 }
b15fe00f
K
172
173 ::ng-deep .tab-content {
174 width: 100% !important;
175 }
176 }
177}
178
179@mixin maximized-tabs-in-mobile-view {
180 // Ellipsis on tabs for mobile view
181 .root.maximized {
182 .nav-preview {
183 ::ng-deep .nav-link {
184 @include ellipsis();
27bc9586 185 @include margin-right(10px !important);
b15fe00f
K
186
187 display: block !important;
188 max-width: 45% !important;
189 padding: 5px 0 !important;
b15fe00f
K
190 text-align: center;
191
192 &:not(.active) {
193 max-width: 15% !important;
194 }
195
196 &.active {
197 padding: 5px 15px !important;
198 }
199 }
200 }
201 }
202}
203
204@mixin in-medium-view {
205 .root {
206 .nav-preview {
207 @include nav-preview-medium();
208 }
209
210 ::ng-deep .tab-content {
211 @include content-preview-base();
212 max-height: 210px;
213 border-bottom: 1px solid $input-border-color;
214 border-left: 1px solid $input-border-color;
215 border-right: 1px solid $input-border-color;
216 border-bottom-left-radius: $input-border-radius;
217 border-bottom-right-radius: $input-border-radius;
218 }
219 }
220}
221
222@mixin maximized-in-medium-view {
223 .root.maximized {
224 @include maximized-base();
225
226 textarea {
227 display: block;
228 padding: $base-padding;
229 border-right: 1px dashed $input-border-color !important;
230 resize: none;
e66883b3 231 scrollbar-color: pvar(--actionButtonColor) pvar(--markdownTextareaBackgroundColor);
b15fe00f
K
232
233 &:focus {
234 box-shadow: none;
235 }
236 }
237 }
238}
239
240@include in-small-view();
241@include maximized-in-small-view();
242
243@media only screen and (max-width: $mobile-view) {
244 @include maximized-tabs-in-mobile-view();
245}
246
247@media only screen and (max-width: #{$mobile-view + $menu-width}) {
248 :host-context(.main-col:not(.expanded)) {
249 @include maximized-tabs-in-mobile-view();
250 }
251}
252
253@media only screen and (min-width: $small-view) {
931d3430
C
254 @include maximized-in-medium-view();
255
b15fe00f
K
256 :host-context(.expanded) {
257 @include in-medium-view();
258 }
b15fe00f
K
259}
260
261@media only screen and (min-width: #{$small-view + $menu-width}) {
262 :host-context(.main-col:not(.expanded)) {
263 @include in-medium-view();
66b16caf
C
264 }
265}