PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.4.0
GenerateBlocks v1.4.0
trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / src / blocks / button / editor.scss
generateblocks / src / blocks / button Last commit date
css 5 years ago attributes.js 4 years ago block.js 4 years ago deprecated.js 5 years ago edit.js 4 years ago editor.scss 5 years ago save.js 5 years ago
editor.scss
166 lines
1 /**
2 * Editor Styles
3 */
4 .gb-button-wrapper {
5 position: relative;
6 margin-top: 0;
7
8 .gb-button {
9 display: flex;
10 justify-content: center;
11 align-items: center;
12 text-align: center;
13 padding: unset;
14 line-height: unset;
15 text-decoration: none !important;
16 border: none;
17 transition: .2s background-color ease-in-out, .2s color ease-in-out, .2s border-color ease-in-out, .2s opacity ease-in-out, .2s box-shadow ease-in-out;
18
19 .editor-rich-text__tinymce {
20 line-height: 1em;
21 }
22 }
23
24 > .block-editor-inner-blocks > .block-editor-block-list__layout {
25 // we need to use inline-flex because of bug with selecting wrapper block in editor.
26 display: flex;
27 flex-wrap: wrap;
28 align-items: flex-start;
29 justify-content: flex-start;
30 margin-right: 0;
31
32 > div {
33 width: auto;
34 }
35 }
36
37 &.gb-button-wrapper-align-right > .block-editor-inner-blocks > .block-editor-block-list__layout {
38 justify-content: flex-end;
39 }
40
41 &.gb-button-wrapper-align-center > .block-editor-inner-blocks > .block-editor-block-list__layout {
42 justify-content: center;
43 }
44
45 > .block-editor-inner-blocks > .block-editor-block-list__layout > * {
46 > .block-editor-block-list__block-edit {
47 margin-top: 0;
48 margin-bottom: 0;
49 }
50 }
51
52 .blocks-format-toolbar__link-modal {
53 top: calc(100% + 2px);
54 left: 50%;
55 transform: translateX(-50%);
56 z-index: 2;
57 }
58
59 .blocks-link-url__suggestions {
60 right: -35px;
61 }
62
63 .blocks-rich-text__tinymce {
64 cursor: text;
65 }
66
67 // add new button
68 .components-button.gblocks-add-button {
69 background: #fff;
70 align-self: center;
71
72 svg {
73 margin-right: 0;
74 }
75 }
76 }
77
78 .gb-button .gb-icon {
79 align-self: center;
80 }
81
82 .using-theme-colors {
83 background-color: #e9f5f9;
84 border-left: 4px solid #409ecd;
85 padding: 10px;
86 }
87
88 .using-theme-colors p:last-child {
89 margin-bottom: 0;
90 }
91
92 .button.gb-button {
93 font-size: inherit;
94 min-height: auto;
95 border-radius: unset;
96 }
97
98 // Reduce the paddings, margins, and UI of inner-blocks.
99 // @todo: eventually we may add a feature that lets a parent container absorb the block UI of a child block.
100 // When that happens, leverage that instead of the following overrides.
101 [data-type="generateblocks/button-container"]="generateblocks/button-container""] {
102 // 1. Reset margins on immediate innerblocks container.
103 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout {
104 margin-left: 0;
105 margin-right: 0;
106 }
107
108 // 2. Remove paddings on subsequent immediate children.
109 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block {
110 width: auto;
111 padding-left: 0;
112 padding-right: 0;
113 margin-left: 0;
114 margin-right: 0;
115 }
116
117 // 3. Remove margins on subsequent Edit container.
118 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block > .block-editor-block-list__block-edit {
119 margin-left: 0;
120 margin-right: 0;
121 }
122
123 // 4. Minimize the block outlines.
124 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block > .block-editor-block-list__block-edit::before {
125 border-right: none;
126 border-top: none;
127 border-bottom: none;
128 }
129
130 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block.is-hovered:not(.is-navigate-mode) > .block-editor-block-list__block-edit::before {
131 box-shadow: none;
132 }
133
134 // 5. Remove the dashed outlines for child blocks.
135 &.is-hovered .gb-button-wrapper .block-editor-block-list__block-edit::before,
136 &.is-selected .gb-button-wrapper .block-editor-block-list__block-edit::before,
137 &.has-child-selected .gb-button-wrapper .block-editor-block-list__block-edit::before {
138 border-color: transparent !important; // !important used to keep the selector from growing any more complex.
139 }
140
141 // 6. Remove vertical margins on subsequent block container.
142 .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block > .block-editor-block-list__block-edit > [data-block]] {
143 margin-top: 0;
144 margin-bottom: 0;
145 }
146
147 // Hide the breadcrumb.
148 // Hide the mover.
149 // Hide the sibling inserter.
150 .gb-button-wrapper .block-editor-block-list__insertion-point,
151 .gb-button-wrapper .block-editor-block-list__breadcrumb { // Needs specificity.
152 display: none;
153 }
154 }
155
156 // Selected/unselected states.
157 // Unselected block is preview, selected has additional options.
158 [data-type="generateblocks/button-container"]="generateblocks/button-container""]:not(.is-selected):not(.has-child-selected) .gb-button-wrapper {
159 min-height: 36px; // This height matches the height of the buttons and ensures an empty block doesn't collapse.
160 }
161
162 .wp-block[data-type="generateblocks/button"]="generateblocks/button""] {
163 margin-top: 0;
164 margin-bottom: 0;
165 }
166