css
6 years ago
attributes.js
6 years ago
block.js
6 years ago
edit.js
6 years ago
editor.scss
6 years ago
save.js
6 years ago
style.scss
6 years ago
editor.scss
161 lines
| 1 | /** |
| 2 | * Editor Styles |
| 3 | */ |
| 4 | @import "../../common"; |
| 5 | |
| 6 | .gb-button-wrapper { |
| 7 | position: relative; |
| 8 | margin-top: 0; |
| 9 | |
| 10 | .gb-button { |
| 11 | display: flex; |
| 12 | justify-content: center; |
| 13 | align-items: center; |
| 14 | text-align: center; |
| 15 | padding: unset; |
| 16 | line-height: unset; |
| 17 | text-decoration: none !important; |
| 18 | border: none; |
| 19 | 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; |
| 20 | |
| 21 | .editor-rich-text__tinymce { |
| 22 | line-height: 1em; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | > .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 27 | // we need to use inline-flex because of bug with selecting wrapper block in editor. |
| 28 | display: flex; |
| 29 | flex-wrap: wrap; |
| 30 | align-items: flex-start; |
| 31 | justify-content: flex-start; |
| 32 | margin-right: 0; |
| 33 | |
| 34 | > div { |
| 35 | width: auto; |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | &.gb-button-wrapper-align-right > .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 40 | justify-content: flex-end; |
| 41 | } |
| 42 | |
| 43 | &.gb-button-wrapper-align-center > .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 44 | justify-content: center; |
| 45 | } |
| 46 | |
| 47 | > .block-editor-inner-blocks > .block-editor-block-list__layout > * { |
| 48 | > .block-editor-block-list__block-edit { |
| 49 | margin-top: 0; |
| 50 | margin-bottom: 0; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | .blocks-format-toolbar__link-modal { |
| 55 | top: calc(100% + 2px); |
| 56 | left: 50%; |
| 57 | transform: translateX(-50%); |
| 58 | z-index: 2; |
| 59 | } |
| 60 | |
| 61 | .blocks-link-url__suggestions { |
| 62 | right: -35px; |
| 63 | } |
| 64 | |
| 65 | .blocks-rich-text__tinymce { |
| 66 | cursor: text; |
| 67 | } |
| 68 | |
| 69 | // add new button |
| 70 | .components-button.gblocks-add-button { |
| 71 | background: #fff; |
| 72 | align-self: center; |
| 73 | |
| 74 | svg { |
| 75 | margin-right: 0; |
| 76 | } |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | .gb-button .gb-icon { |
| 81 | align-self: center; |
| 82 | } |
| 83 | |
| 84 | .using-theme-colors { |
| 85 | background-color: #e9f5f9; |
| 86 | border-left: 4px solid #409ecd; |
| 87 | padding: 10px; |
| 88 | } |
| 89 | |
| 90 | .using-theme-colors p:last-child { |
| 91 | margin-bottom: 0; |
| 92 | } |
| 93 | |
| 94 | .button.gb-button { |
| 95 | font-size: inherit; |
| 96 | min-height: auto; |
| 97 | border-radius: unset; |
| 98 | } |
| 99 | |
| 100 | // Reduce the paddings, margins, and UI of inner-blocks. |
| 101 | // @todo: eventually we may add a feature that lets a parent container absorb the block UI of a child block. |
| 102 | // When that happens, leverage that instead of the following overrides. |
| 103 | [data-type="generateblocks/button-container"]="generateblocks/button-container""] { |
| 104 | // 1. Reset margins on immediate innerblocks container. |
| 105 | .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout { |
| 106 | margin-left: 0; |
| 107 | margin-right: 0; |
| 108 | } |
| 109 | |
| 110 | // 2. Remove paddings on subsequent immediate children. |
| 111 | .gb-button-wrapper > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block { |
| 112 | width: auto; |
| 113 | padding-left: 0; |
| 114 | padding-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 |