PluginProbe
Block Animations, Motion & Scroll Effects – Ghost Kit / 3.3.2
Block Animations, Motion & Scroll Effects – Ghost Kit v3.3.2
3.7.2 3.7.1 3.7.0 3.6.1 trunk 1.6.3 2.25.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.5.0 3.5.1 3.6.0
ghostkit / gutenberg / wordpress / base-styles / _mixins.scss

_mixins.scss in Block Animations, Motion & Scroll Effects – Ghost Kit 3.3.2, at gutenberg/wordpress/base-styles/_mixins.scss

680 lines 14.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /**
2 * Breakpoint mixins
3 */
4
5 @mixin break-huge() {
6 @media (min-width: #{ ($break-huge) }) {
7 @content;
8 }
9 }
10
11 @mixin break-wide() {
12 @media (min-width: #{ ($break-wide) }) {
13 @content;
14 }
15 }
16
17 @mixin break-xlarge() {
18 @media (min-width: #{ ($break-xlarge) }) {
19 @content;
20 }
21 }
22
23 @mixin break-large() {
24 @media (min-width: #{ ($break-large) }) {
25 @content;
26 }
27 }
28
29 @mixin break-medium() {
30 @media (min-width: #{ ($break-medium) }) {
31 @content;
32 }
33 }
34
35 @mixin break-small() {
36 @media (min-width: #{ ($break-small) }) {
37 @content;
38 }
39 }
40
41 @mixin break-mobile() {
42 @media (min-width: #{ ($break-mobile) }) {
43 @content;
44 }
45 }
46
47 @mixin break-zoomed-in() {
48 @media (min-width: #{ ($break-zoomed-in) }) {
49 @content;
50 }
51 }
52
53
54 /**
55 * Long content fade mixin
56 *
57 * Creates a fading overlay to signify that the content is longer
58 * than the space allows.
59 */
60
61 @mixin long-content-fade($direction: right, $size: 20%, $color: #fff, $edge: 0, $z-index: false) {
62 content: "";
63 display: block;
64 position: absolute;
65 -webkit-touch-callout: none;
66 -webkit-user-select: none;
67 -khtml-user-select: none;
68 -moz-user-select: none;
69 -ms-user-select: none;
70 user-select: none;
71 pointer-events: none;
72
73 @if $z-index {
74 z-index: $z-index;
75 }
76
77 @if $direction == "bottom" {
78 background: linear-gradient(to top, rgba($color, 0), $color 90%);
79 left: $edge;
80 right: $edge;
81 top: $edge;
82 bottom: calc(100% - $size);
83 width: auto;
84 }
85
86 @if $direction == "top" {
87 background: linear-gradient(to bottom, rgba($color, 0), $color 90%);
88 top: calc(100% - $size);
89 left: $edge;
90 right: $edge;
91 bottom: $edge;
92 width: auto;
93 }
94
95 @if $direction == "left" {
96 background: linear-gradient(to left, rgba($color, 0), $color 90%);
97 top: $edge;
98 left: $edge;
99 bottom: $edge;
100 right: auto;
101 width: $size;
102 height: auto;
103 }
104
105 @if $direction == "right" {
106 background: linear-gradient(to right, rgba($color, 0), $color 90%);
107 top: $edge;
108 bottom: $edge;
109 right: $edge;
110 left: auto;
111 width: $size;
112 height: auto;
113 }
114 }
115
116 /**
117 * Focus styles.
118 */
119
120 @mixin block-toolbar-button-style__focus() {
121 box-shadow: inset 0 0 0 $border-width-focus var(--wp-admin-theme-color), inset 0 0 0 4px $white;
122
123 // Windows High Contrast mode will show this outline, but not the box-shadow.
124 outline: 2px solid transparent;
125 }
126
127 // Tabs, Inputs, Square buttons.
128 @mixin input-style__neutral() {
129 box-shadow: 0 0 0 transparent;
130 transition: box-shadow 0.1s linear;
131 border-radius: $radius-block-ui;
132 border: $border-width solid $gray-700;
133 @include reduce-motion("transition");
134 }
135
136
137 @mixin input-style__focus() {
138 border-color: var(--wp-admin-theme-color);
139 box-shadow: 0 0 0 ($border-width-focus - $border-width) var(--wp-admin-theme-color);
140
141 // Windows High Contrast mode will show this outline, but not the box-shadow.
142 outline: 2px solid transparent;
143 }
144
145
146 /**
147 * Applies editor left position to the selector passed as argument
148 */
149
150 @mixin editor-left($selector) {
151 #{$selector} { /* Set left position when auto-fold is not on the body element. */
152 left: 0;
153
154 @media (min-width: #{ ($break-medium + 1) }) {
155 left: $admin-sidebar-width;
156 }
157 }
158
159 .auto-fold #{$selector} { /* Auto fold is when on smaller breakpoints, nav menu auto collapses. */
160 @media (min-width: #{ ($break-medium + 1) }) {
161 left: $admin-sidebar-width-collapsed;
162 }
163
164 @media (min-width: #{ ($break-large + 1) }) {
165 left: $admin-sidebar-width;
166 }
167 }
168
169 /* Sidebar manually collapsed. */
170 .folded #{$selector} {
171 left: 0;
172
173 @media (min-width: #{ ($break-medium + 1) }) {
174 left: $admin-sidebar-width-collapsed;
175 }
176 }
177
178 /* Mobile menu opened. */
179 @media (max-width: #{ ($break-medium + 1) }) {
180 .auto-fold .wp-responsive-open #{$selector} {
181 left: $admin-sidebar-width-big;
182 }
183 }
184
185 /* In small screens with responsive menu expanded there is small white space. */
186 @media (max-width: #{ ($break-small) }) {
187 .auto-fold .wp-responsive-open #{$selector} {
188 margin-left: -18px;
189 }
190 }
191
192 body.is-fullscreen-mode #{$selector} {
193 left: 0 !important;
194 }
195 }
196
197 /**
198 * Styles that are reused verbatim in a few places
199 */
200
201 // These are additional styles for all captions, when the theme opts in to block styles.
202 @mixin caption-style() {
203 margin-top: 0.5em;
204 margin-bottom: 1em;
205 }
206
207 @mixin caption-style-theme() {
208 color: $dark-gray-500;
209 font-size: $default-font-size;
210 text-align: center;
211 }
212
213
214 /**
215 * Allows users to opt-out of animations via OS-level preferences.
216 */
217
218 @mixin reduce-motion($property: "") {
219
220 @if $property == "transition" {
221 @media (prefers-reduced-motion: reduce) {
222 transition-duration: 0s;
223 }
224 }
225
226 @else if $property == "animation" {
227 @media (prefers-reduced-motion: reduce) {
228 animation-duration: 1ms;
229 }
230 }
231
232 @else {
233 @media (prefers-reduced-motion: reduce) {
234 transition-duration: 0s;
235 animation-duration: 1ms;
236 }
237 }
238
239 }
240
241 @mixin input-control {
242 font-family: $default-font;
243 padding: 6px 8px;
244 @include input-style__neutral();
245
246 /* Fonts smaller than 16px causes mobile safari to zoom. */
247 font-size: $mobile-text-min-font-size;
248 /* Override core line-height. To be reviewed. */
249 line-height: normal;
250 @include break-small {
251 font-size: $default-font-size;
252 /* Override core line-height. To be reviewed. */
253 line-height: normal;
254 }
255
256 &:focus {
257 @include input-style__focus();
258 }
259
260 // Use opacity to work in various editor styles.
261 &::-webkit-input-placeholder {
262 color: $dark-gray-placeholder;
263 }
264
265 &::-moz-placeholder {
266 opacity: 1; // Necessary because Firefox reduces this from 1.
267 color: $dark-gray-placeholder;
268 }
269
270 &:-ms-input-placeholder {
271 color: $dark-gray-placeholder;
272 }
273
274 .is-dark-theme & {
275 &::-webkit-input-placeholder {
276 color: $light-gray-placeholder;
277 }
278
279 &::-moz-placeholder {
280 opacity: 1; // Necessary because Firefox reduces this from 1.
281 color: $light-gray-placeholder;
282 }
283
284 &:-ms-input-placeholder {
285 color: $light-gray-placeholder;
286 }
287 }
288 }
289
290 @mixin checkbox-control {
291 @include input-control;
292 border: $border-width solid $gray-900;
293 margin-right: $grid-unit-15;
294 transition: none;
295 border-radius: $radius-block-ui;
296
297 &:focus {
298 box-shadow: 0 0 0 ($border-width * 2) $white, 0 0 0 ($border-width * 2 + $border-width-focus) var(--wp-admin-theme-color);
299
300 // Only visible in Windows High Contrast mode.
301 outline: 2px solid transparent;
302 }
303
304 &:checked {
305 background: var(--wp-admin-theme-color);
306 border-color: var(--wp-admin-theme-color);
307
308 // Hide default checkbox styles in IE.
309 &::-ms-check {
310 opacity: 0;
311 }
312 }
313
314 &:checked::before,
315 &[aria-checked="mixed"]="mixed""]::before {
316 margin: -3px -5px;
317 color: $white;
318
319 @include break-medium() {
320 margin: -4px 0 0 -5px;
321 }
322 }
323
324 &[aria-checked="mixed"]="mixed""] {
325 background: var(--wp-admin-theme-color);
326 border-color: var(--wp-admin-theme-color);
327
328 &::before {
329 // Inherited from `forms.css`.
330 // See: https://github.com/WordPress/wordpress-develop/tree/5.1.1/src/wp-admin/css/forms.css#L122-L132
331 content: "\f460";
332 float: left;
333 display: inline-block;
334 vertical-align: middle;
335 width: 16px;
336 /* stylelint-disable */
337 font: normal 30px/1 dashicons;
338 /* stylelint-enable */
339 speak: none;
340 -webkit-font-smoothing: antialiased;
341 -moz-osx-font-smoothing: grayscale;
342
343 @include break-medium() {
344 float: none;
345 font-size: 21px;
346 }
347 }
348 }
349 }
350
351 @mixin radio-control {
352 @include input-control;
353 border: $border-width solid $gray-900;
354 margin-right: $grid-unit-15;
355 transition: none;
356 border-radius: $radius-round;
357
358 &:checked::before {
359 width: 7px;
360 height: 7px;
361 margin: 8px 0 0 8px;
362 background-color: $white;
363
364 // This border serves as a background color in Windows High Contrast mode.
365 border: 3px solid $white;
366
367 @include break-medium() {
368 width: 6px;
369 height: 6px;
370 margin: 4px 0 0 4px;
371 }
372 }
373
374 &:focus {
375 box-shadow: 0 0 0 ($border-width * 2) $white, 0 0 0 ($border-width * 2 + $border-width-focus) var(--wp-admin-theme-color);
376
377 // Only visible in Windows High Contrast mode.
378 outline: 2px solid transparent;
379 }
380
381 &:checked {
382 background: var(--wp-admin-theme-color);
383 border-color: var(--wp-admin-theme-color);
384 }
385 }
386
387 /**
388 * Reset default styles for JavaScript UI based pages.
389 * This is a WP-admin agnostic reset
390 */
391 @mixin reset {
392 box-sizing: border-box;
393
394 *,
395 *::before,
396 *::after {
397 box-sizing: inherit;
398 }
399 }
400
401 /**
402 * Reset the WP Admin page styles for Gutenberg-like pages.
403 */
404 @mixin wp-admin-reset( $content-container ) {
405 background: $white;
406
407 #wpcontent {
408 padding-left: 0;
409 }
410
411 #wpbody-content {
412 padding-bottom: 0;
413 }
414
415 /* We hide legacy notices in Gutenberg Based Pages, because they were not designed in a way that scaled well.
416 Plugins can use Gutenberg notices if they need to pass on information to the user when they are editing. */
417 #wpbody-content > div:not(#{ $content-container }):not(#screen-meta) {
418 display: none;
419 }
420
421 #wpfooter {
422 display: none;
423 }
424
425 .a11y-speak-region {
426 left: -1px;
427 top: -1px;
428 }
429
430 ul#adminmenu a.wp-has-current-submenu::after,
431 ul#adminmenu > li.current > a.current::after {
432 border-right-color: $white;
433 }
434
435 .media-frame select.attachment-filters:last-of-type {
436 width: auto;
437 max-width: 100%;
438 }
439 }
440
441 @mixin admin-scheme($color-primary) {
442 --wp-admin-theme-color: #{$color-primary};
443
444 // Darker shades.
445 --wp-admin-theme-color-darker-10: #{darken($color-primary, 5%)};
446 --wp-admin-theme-color-darker-20: #{darken($color-primary, 10%)};
447 }
448
449 @mixin wordpress-admin-schemes() {
450 body.admin-color-light {
451 @include admin-scheme(#0085ba);
452 }
453
454 body.admin-color-modern {
455 @include admin-scheme(#3858e9);
456 }
457
458 body.admin-color-blue {
459 @include admin-scheme(#096484);
460 }
461
462 body.admin-color-coffee {
463 @include admin-scheme(#46403c);
464 }
465
466 body.admin-color-ectoplasm {
467 @include admin-scheme(#523f6d);
468 }
469
470 body.admin-color-midnight {
471 @include admin-scheme(#e14d43);
472 }
473
474 body.admin-color-ocean {
475 @include admin-scheme(#627c83);
476 }
477
478 body.admin-color-sunrise {
479 @include admin-scheme(#dd823b);
480 }
481 }
482
483 @mixin background-colors() {
484 .has-pale-pink-background-color {
485 background-color: #f78da7;
486 }
487
488 .has-vivid-red-background-color {
489 background-color: #cf2e2e;
490 }
491
492 .has-luminous-vivid-orange-background-color {
493 background-color: #ff6900;
494 }
495
496 .has-luminous-vivid-amber-background-color {
497 background-color: #fcb900;
498 }
499
500 .has-light-green-cyan-background-color {
501 background-color: #7bdcb5;
502 }
503
504 .has-vivid-green-cyan-background-color {
505 background-color: #00d084;
506 }
507
508 .has-pale-cyan-blue-background-color {
509 background-color: #8ed1fc;
510 }
511
512 .has-vivid-cyan-blue-background-color {
513 background-color: #0693e3;
514 }
515
516 .has-vivid-purple-background-color {
517 background-color: #9b51e0;
518 }
519
520 .has-white-background-color {
521 background-color: #fff;
522 }
523
524 // Deprecated from UI, kept for back-compat.
525 .has-very-light-gray-background-color {
526 background-color: #eee;
527 }
528
529 .has-cyan-bluish-gray-background-color {
530 background-color: #abb8c3;
531 }
532
533 // Deprecated from UI, kept for back-compat.
534 .has-very-dark-gray-background-color {
535 background-color: #313131;
536 }
537
538 .has-black-background-color {
539 background-color: #000;
540 }
541 }
542
543 @mixin foreground-colors() {
544 .has-pale-pink-color {
545 color: #f78da7;
546 }
547
548 .has-vivid-red-color {
549 color: #cf2e2e;
550 }
551
552 .has-luminous-vivid-orange-color {
553 color: #ff6900;
554 }
555
556 .has-luminous-vivid-amber-color {
557 color: #fcb900;
558 }
559
560 .has-light-green-cyan-color {
561 color: #7bdcb5;
562 }
563
564 .has-vivid-green-cyan-color {
565 color: #00d084;
566 }
567
568 .has-pale-cyan-blue-color {
569 color: #8ed1fc;
570 }
571
572 .has-vivid-cyan-blue-color {
573 color: #0693e3;
574 }
575
576 .has-vivid-purple-color {
577 color: #9b51e0;
578 }
579
580 .has-white-color {
581 color: #fff;
582 }
583
584 // Deprecated from UI, kept for back-compat.
585 .has-very-light-gray-color {
586 color: #eee;
587 }
588
589 .has-cyan-bluish-gray-color {
590 color: #abb8c3;
591 }
592
593 // Deprecated from UI, kept for back-compat.
594 .has-very-dark-gray-color {
595 color: #313131;
596 }
597
598 .has-black-color {
599 color: #000;
600 }
601 }
602
603 @mixin gradient-colors() {
604 // Our classes uses the same values we set for gradient value attributes, and we can not use spacing because of WP multi site kses rule.
605
606 /* stylelint-disable function-comma-space-after */
607 .has-vivid-cyan-blue-to-vivid-purple-gradient-background {
608 background: linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%);
609 }
610
611 .has-vivid-green-cyan-to-vivid-cyan-blue-gradient-background {
612 background: linear-gradient(135deg,rgba(0,208,132,1) 0%,rgba(6,147,227,1) 100%);
613 }
614
615 .has-light-green-cyan-to-vivid-green-cyan-gradient-background {
616 background: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);
617 }
618
619 .has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background {
620 background: linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%);
621 }
622
623 .has-luminous-vivid-orange-to-vivid-red-gradient-background {
624 background: linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%);
625 }
626
627 .has-very-light-gray-to-cyan-bluish-gray-gradient-background {
628 background: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);
629 }
630
631 .has-cool-to-warm-spectrum-gradient-background {
632 background: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);
633 }
634
635 .has-blush-light-purple-gradient-background {
636 background: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);
637 }
638
639 .has-blush-bordeaux-gradient-background {
640 background: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);
641 }
642
643 .has-purple-crush-gradient-background {
644 background: linear-gradient(135deg,rgb(52,226,228) 0%,rgb(71,33,251) 50%,rgb(171,29,254) 100%);
645 }
646
647 .has-luminous-dusk-gradient-background {
648 background: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);
649 }
650
651 .has-hazy-dawn-gradient-background {
652 background: linear-gradient(135deg,rgb(250,172,168) 0%,rgb(218,208,236) 100%);
653 }
654
655 .has-pale-ocean-gradient-background {
656 background: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);
657 }
658
659 .has-electric-grass-gradient-background {
660 background: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);
661 }
662
663 .has-subdued-olive-gradient-background {
664 background: linear-gradient(135deg,rgb(250,250,225) 0%,rgb(103,166,113) 100%);
665 }
666
667 .has-atomic-cream-gradient-background {
668 background: linear-gradient(135deg,rgb(253,215,154) 0%,rgb(0,74,89) 100%);
669 }
670
671 .has-nightshade-gradient-background {
672 background: linear-gradient(135deg,rgb(51,9,104) 0%,rgb(49,205,207) 100%);
673 }
674
675 .has-midnight-gradient-background {
676 background: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);
677 }
678 /* stylelint-enable function-comma-space-after */
679 }
680