| 1 |
/** |
| 2 |
* CSS for the TablePress table block in the block editor. |
| 3 |
* |
| 4 |
* @package TablePress |
| 5 |
* @subpackage Blocks |
| 6 |
* @author Tobias Bäthge |
| 7 |
* @since 2.0.0 |
| 8 |
*/ |
| 9 |
|
| 10 |
.wp-block-tablepress-table { |
| 11 |
$parent: &; |
| 12 |
|
| 13 |
/* Limit the height of server-side render preview in the block editor. */ |
| 14 |
> .render-wrapper { |
| 15 |
overflow: scroll; |
| 16 |
min-height: 64px; |
| 17 |
max-height: 400px; |
| 18 |
|
| 19 |
> .tablepress { |
| 20 |
/* Prevent interaction with elements like links inside tables, similar to the `Disabled` component from Gutenberg. */ |
| 21 |
pointer-events: none; |
| 22 |
/* Remove the bottom margin in the block preview. */ |
| 23 |
margin: 0 auto; |
| 24 |
} |
| 25 |
} |
| 26 |
|
| 27 |
/* Hide the server-side render wrapper while it's being refreshed. */ |
| 28 |
> div > div > .render-wrapper { |
| 29 |
display: none; |
| 30 |
} |
| 31 |
|
| 32 |
/* Move the loading spinner inside the table overlay. */ |
| 33 |
> div > div { |
| 34 |
margin-top: 8px !important; /* The !important flag is necessary to overwrite an inline style. */ |
| 35 |
} |
| 36 |
|
| 37 |
/* Show an overlay on top of the table, to indicate that it's not fully shown. */ |
| 38 |
@at-root .table-overlay { |
| 39 |
#{$parent} & { |
| 40 |
box-sizing: border-box; |
| 41 |
top: 0; |
| 42 |
width: 100%; |
| 43 |
height: 100%; |
| 44 |
box-shadow: inset 0 0 50px #cccccc; |
| 45 |
background-color: rgba(255, 255, 255, 0.5); |
| 46 |
padding: 2em; |
| 47 |
font-weight: bold; |
| 48 |
|
| 49 |
/* Hide the table overlay in the block preview. */ |
| 50 |
.block-editor-block-preview__content-iframe & { |
| 51 |
display: none; |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
/* Position the table overlay above the table preview once it's loaded. */ |
| 56 |
#{$parent} .render-wrapper + & { |
| 57 |
position: absolute; |
| 58 |
} |
| 59 |
|
| 60 |
/* Hide the table overlay when it's hovered while a table preview is shown. */ |
| 61 |
#{$parent}:hover .render-wrapper + & { |
| 62 |
display: none; |
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
/* Reduce height of the block placeholder (when no table has been selected) from the default 200px. */ |
| 67 |
.components-placeholder { |
| 68 |
min-height: 160px; |
| 69 |
} |
| 70 |
|
| 71 |
/* Fix right margin, as the 1ch unit in the WP CSS does not work with the Dashicon font. */ |
| 72 |
.components-placeholder__label .dashicon { |
| 73 |
margin-right: 10px; |
| 74 |
} |
| 75 |
|
| 76 |
/* Reduce line height of the placeholder instructions when the text is wrapped. */ |
| 77 |
.components-placeholder__instructions { |
| 78 |
line-height: normal; |
| 79 |
} |
| 80 |
|
| 81 |
/* Elements inside the InspectorControls PanelBodys. */ |
| 82 |
&-inspector-panel { |
| 83 |
/* Make the indeterminate state of a checkbox lighter. */ |
| 84 |
.components-checkbox-control__input[type="checkbox"]="checkbox""] { |
| 85 |
&:indeterminate { |
| 86 |
opacity: 0.4; |
| 87 |
} |
| 88 |
} |
| 89 |
} |
| 90 |
|
| 91 |
/* Hide the "Edit" link below the table. */ |
| 92 |
.tablepress caption { |
| 93 |
display: none; |
| 94 |
} |
| 95 |
} |
| 96 |
|