Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #45 from ckeditor/t/2
Browse files Browse the repository at this point in the history
Feature: The MVP of table content styles. Moved styles related to the editing to ckeditor5-theme-lark (see #2).
  • Loading branch information
dkonopka authored Jun 13, 2018
2 parents 83a2609 + da6a36a commit d4dc54d
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 43 deletions.
2 changes: 2 additions & 0 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import TableEditing from './tableediting';
import TableUI from './tableui';
import Widget from '@ckeditor/ckeditor5-widget/src/widget';

import '../theme/table.css';

/**
* The table plugin.
*
Expand Down
2 changes: 1 addition & 1 deletion src/tableediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import SetHeaderColumnCommand from './commands/setheadercolumncommand';
import { getParentTable } from './commands/utils';
import TableUtils from './tableutils';

import './../theme/table.css';
import '../theme/tableediting.css';

/**
* The table editing feature.
Expand Down
29 changes: 4 additions & 25 deletions tests/manual/table.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,7 @@
<style>

table {
border-collapse: collapse;
border-spacing: 0;
border-color: hsl(0,0%,87%);
}

table, th, td {
padding: 5px;
border: 1px inset hsl(0,0%,87%);
}

table th,
table td {
min-width: 1em;
}

table th {
background: hsl(0,0%,96%);
font-weight: bold;
}

table thead th {
background: hsl(0,0%,90%);
body {
font-family: Helvetica, Arial, sans-serif;
font-size: 14px;
}
</style>

Expand All @@ -47,7 +26,7 @@
</thead>
<tbody>
<tr>
<th colspan="2" rowspan="4" scope="rowgroup">Terrestial planets</th>
<th colspan="2" rowspan="4" scope="rowgroup">Terrestrial planets</th>
<th scope="row">Mercury</th>
<td>0.330</td>
<td>4,879</td>
Expand Down
40 changes: 23 additions & 17 deletions theme/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,30 @@
* For licensing, see LICENSE.md.
*/

.ck table.ck-widget th.ck-editor__nested-editable {
border-color: inherit;
border-style: inset;
}
.ck.ck-content table {
/* Give the table some air and center it horizontally */
margin: 1em auto;

.ck table.ck-widget td.ck-editor__nested-editable {
border-color: inherit;
border-style: inset;
}
/* The table cells should have slight borders */
border-collapse: collapse;
border-spacing: 0;

.ck table.ck-widget td.ck-editor__nested-editable.ck-editor__nested-editable_focused,
.ck table.ck-widget td.ck-editor__nested-editable:focus {
background-color: inherit;
color: inherit;
}
/* The outer border of the table should be slightly darker than the inner lines. */
&:not(:hover) {
outline: 1px solid hsl(0, 0%, 70%);
outline-offset: -1px;
}

& td,
& th {
min-width: 2em;
padding: .4em;
text-align: center;
border-color: hsl(0, 0%, 85%);
}

.ck table.ck-widget th.ck-editor__nested-editable.ck-editor__nested-editable_focused,
.ck table.ck-widget th.ck-editor__nested-editable:focus {
background-color: inherit;
color: inherit;
& th {
font-weight: bold;
background: hsl(0, 0%, 98%);
}
}
10 changes: 10 additions & 0 deletions theme/tableediting.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/*
* Note: This file should contain the wireframe styles only. But since there are no such styles,
* it acts as a message to the builder telling that it should look for the corresponding styles
* **in the theme** when compiling the editor.
*/

0 comments on commit d4dc54d

Please sign in to comment.