PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.18.0
GiveWP – Donation Plugin and Fundraising Platform v4.18.0
4.18.0 4.17.0 4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 All 257 releases
give / src / DonationForms / resources / shared / EmbedFrame / styles.scss

styles.scss in GiveWP – Donation Plugin and Fundraising Platform 4.18.0, at src/DonationForms/resources/shared/EmbedFrame/styles.scss

130 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 @import '../../styles/skeleton';
2
3 /*
4 * Host pages do not load the design system foundation stylesheet (only the form inside the
5 * iframe does), so the values here are self-contained. The spinner accent follows the same
6 * --givewp-primary-color the launcher buttons use.
7 */
8 .givewp-embed-frame {
9 position: relative;
10
11 &[data-state='loading']='loading'],
12 &[data-state='slow']='slow'] {
13 min-height: 20rem;
14 }
15
16 &__loading {
17 position: absolute;
18 inset: 0;
19 display: flex;
20 align-items: center;
21 justify-content: center;
22 }
23
24 &__spinner {
25 width: 2.5rem;
26 height: 2.5rem;
27 border-radius: 50%;
28 border: 3px solid rgba(0, 0, 0, 0.12);
29 border-top-color: var(--givewp-primary-color, rgba(0, 0, 0, 0.55));
30 animation: givewp-embed-frame-spin 0.8s linear infinite;
31 }
32
33 /*
34 * A skeleton sits in normal flow and sets the frame's height itself; the spinner keeps the
35 * absolute, centered layout above.
36 */
37 &[data-placeholder='skeleton']='skeleton'] &__loading {
38 position: static;
39 display: block;
40 /* The skeleton's container queries resolve against this box, the same width as the iframe. */
41 container-type: inline-size;
42 }
43
44 &__iframe {
45 width: 1px;
46 min-width: 100%;
47 border: 0;
48 visibility: hidden;
49 opacity: 0;
50 transition: opacity 0.2s ease;
51 }
52
53 /* Until the handshake the iframe's default height must not add to the placeholder's. */
54 &[data-state='loading']='loading'] &__iframe,
55 &[data-state='slow']='slow'] &__iframe {
56 position: absolute;
57 top: 0;
58 left: 0;
59 }
60
61 &[data-state='ready']='ready'] &__iframe {
62 visibility: visible;
63 opacity: 1;
64 }
65
66 /*
67 * Overlays the placeholder rather than sitting under it: a skeleton can be taller than the
68 * viewport, so anything below it lands below the fold where nobody scrolls to it.
69 */
70 &__fallback {
71 position: absolute;
72 z-index: 1;
73 margin: 0;
74 text-align: center;
75 animation: givewp-embed-frame-fade-in 0.3s ease;
76
77 /* The donate-button stylesheet styles the link as a pill, so give it its own centered line. */
78 a {
79 display: block;
80 width: fit-content;
81 margin: 0.75rem auto 0;
82 }
83 }
84
85 /* The spinner is short and centered, so the message fits along the bottom of the frame. */
86 &[data-placeholder='spinner']='spinner'] &__fallback {
87 inset: auto 0 1rem;
88 }
89
90 /* Over a skeleton the message becomes a card at the top edge, where the viewer already is. */
91 &[data-placeholder='skeleton']='skeleton'] &__fallback {
92 top: 1rem;
93 left: 50%;
94 box-sizing: border-box;
95 /* With `left: 50%` the shrink-to-fit space is half the frame, so size to the text and let
96 the cap do the wrapping. */
97 width: max-content;
98 max-width: min(28rem, calc(100% - 2rem));
99 padding: 1rem 1.5rem;
100 background-color: #fff;
101 border: 1px solid rgba(0, 0, 0, 0.08);
102 border-radius: 0.5rem;
103 box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15);
104 transform: translateX(-50%);
105 }
106 }
107
108 @keyframes givewp-embed-frame-spin {
109 to {
110 transform: rotate(360deg);
111 }
112 }
113
114 @keyframes givewp-embed-frame-fade-in {
115 from {
116 opacity: 0;
117 }
118 }
119
120 @media (prefers-reduced-motion: reduce) {
121 .givewp-embed-frame__iframe {
122 transition: none;
123 }
124
125 .givewp-embed-frame__spinner,
126 .givewp-embed-frame__fallback {
127 animation: none;
128 }
129 }
130