UNPKG

2.64 kBSCSSView Raw
1// Override the default list style type _only in the editor_
2// to avoid :not() selector specificity issues.
3// See https://github.com/WordPress/gutenberg/pull/10358
4ul.wp-block-gallery li {
5 list-style-type: none;
6}
7
8.blocks-gallery-item {
9
10 // Hide the focus outline that otherwise briefly appears when selecting a block.
11 figure:not(.is-selected):focus {
12 outline: none;
13 }
14
15 .is-selected {
16 outline: 4px solid theme(primary);
17 }
18
19 .is-transient img {
20 opacity: 0.3;
21 }
22
23 .block-editor-rich-text {
24 position: absolute;
25 bottom: 0;
26 width: 100%;
27 max-height: 100%;
28 overflow-y: auto;
29 }
30
31 .block-editor-rich-text figcaption:not([data-is-placeholder-visible="true"]) {
32 position: relative;
33 overflow: hidden;
34 }
35
36 .is-selected .block-editor-rich-text {
37 // IE calculates this incorrectly, so leave it to modern browsers.
38 @supports (position: sticky) {
39 right: 0;
40 left: 0;
41 margin-top: -4px;
42 }
43
44 // Override negative margins so this toolbar isn't hidden by overflow. Overflow is needed for long captions.
45 .block-editor-rich-text__inline-toolbar {
46 top: 0;
47 }
48
49 // Make extra space for the inline toolbar.
50 figcaption {
51 padding-top: 48px;
52 }
53 }
54
55 .components-form-file-upload,
56 .components-button.block-library-gallery-add-item-button {
57 width: 100%;
58 height: 100%;
59 }
60
61 .components-button.block-library-gallery-add-item-button {
62 display: flex;
63 flex-direction: column;
64 justify-content: center;
65 box-shadow: none;
66 border: none;
67 border-radius: 0;
68 min-height: 100px;
69
70 & .dashicon {
71 margin-top: 10px;
72 }
73
74 &:hover,
75 &:focus {
76 border: $border-width solid $dark-gray-500;
77 }
78 }
79
80 .block-editor-rich-text figcaption {
81 a {
82 color: $white;
83 }
84 }
85}
86
87.block-library-gallery-item__inline-menu {
88 padding: 2px;
89 position: absolute;
90 top: -2px;
91 right: -2px;
92 background-color: theme(primary);
93 display: inline-flex;
94 z-index: z-index(".block-library-gallery-item__inline-menu");
95
96 .components-button {
97 color: $white;
98 &:hover,
99 &:focus {
100 color: $white;
101 }
102 }
103}
104
105.blocks-gallery-item__remove {
106 padding: 0;
107
108 &.components-button:focus {
109 color: inherit;
110 }
111}
112
113.blocks-gallery-item .components-spinner {
114 position: absolute;
115 top: 50%;
116 left: 50%;
117 margin-top: -9px;
118 margin-left: -9px;
119}
120
121// Last item always needs margins reset.
122// When block is selected, only reset the right margin of the 2nd to last item.
123.wp-block-gallery {
124 .is-selected & .blocks-gallery-image:nth-last-child(2),
125 .is-selected & .blocks-gallery-item:nth-last-child(2),
126 .is-typing & .blocks-gallery-image:nth-last-child(2),
127 .is-typing & .blocks-gallery-item:nth-last-child(2) {
128 margin-right: 0;
129 }
130}