UNPKG

2.3 kBCSSView Raw
1/*
2 * Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3 * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4 */
5
6:root {
7 --ck-color-table-column-resizer-hover: var(--ck-color-base-active);
8 --ck-table-column-resizer-width: 7px;
9
10 /* The offset used for absolute positioning of the resizer element, so that it is placed exactly above the cell border.
11 The value is: minus half the width of the resizer decreased additionaly by the half the width of the border (0.5px). */
12 --ck-table-column-resizer-position-offset: calc(var(--ck-table-column-resizer-width) * -0.5 - 0.5px);
13}
14
15.ck-content .table .ck-table-resized {
16 table-layout: fixed;
17}
18
19.ck-content .table table {
20 overflow: hidden;
21}
22
23.ck-content .table td,
24.ck-content .table th {
25 position: relative;
26}
27
28.ck.ck-editor__editable .table .ck-table-column-resizer {
29 position: absolute;
30 /* The resizer element resides in each cell so to occupy the entire height of the table, which is unknown from a CSS point of view,
31 it is extended to an extremely high height. Even for screens with a very high pixel density, the resizer will fulfill its role as
32 it should, i.e. for a screen of 476 ppi the total height of the resizer will take over 350 sheets of A4 format, which is totally
33 unrealistic height for a single table. */
34 top: -999999px;
35 bottom: -999999px;
36 right: var(--ck-table-column-resizer-position-offset);
37 width: var(--ck-table-column-resizer-width);
38 cursor: col-resize;
39 user-select: none;
40 z-index: var(--ck-z-default);
41}
42
43.ck.ck-editor__editable.ck-column-resize_disabled .table .ck-table-column-resizer {
44 display: none;
45}
46
47/* The resizer elements, which are extended to an extremely high height, break the drag & drop feature in Chrome. To make it work again,
48 all resizers must be hidden while the table is dragged. */
49.ck.ck-editor__editable .table[draggable] .ck-table-column-resizer {
50 display: none;
51}
52
53.ck.ck-editor__editable .table .ck-table-column-resizer:hover,
54.ck.ck-editor__editable .table .ck-table-column-resizer__active {
55 background-color: var(--ck-color-table-column-resizer-hover);
56 opacity: 0.25;
57}
58
59.ck.ck-editor__editable[dir=rtl] .table .ck-table-column-resizer {
60 left: var(--ck-table-column-resizer-position-offset);
61 right: unset;
62}