[IMP] web_editor: restyle tables in editor

- reduce the default row height to get a padding of .5rem instead of .75
- use a darker grey for table border color

task-2858455

Part-of: odoo/odoo#92200
This commit is contained in:
Antoine Guenet
2022-08-26 17:16:31 +02:00
parent d3d4443e13
commit 68999cd95f
3 changed files with 6 additions and 2 deletions
@@ -2224,7 +2224,7 @@ export class OdooEditor extends EventTarget {
container.innerHTML = clipboardData;
for (const tableElement of container.querySelectorAll('table')) {
tableElement.classList.add('table', 'table-bordered');
tableElement.classList.add('table', 'table-bordered', 'o_table');
}
for (const child of [...container.childNodes]) {
@@ -1,3 +1,7 @@
li.oe-nested {
display: block;
}
.o_table tr td {
padding: 0.5rem;
border-color: #c9ccd2;
}
@@ -834,7 +834,7 @@ export const editorCommands = {
insertTable: (editor, { rowNumber = 2, colNumber = 2 } = {}) => {
const tdsHtml = new Array(colNumber).fill('<td><p><br></p></td>').join('');
const trsHtml = new Array(rowNumber).fill(`<tr>${tdsHtml}</tr>`).join('');
const tableHtml = `<table class="table table-bordered"><tbody>${trsHtml}</tbody></table>`;
const tableHtml = `<table class="table table-bordered o_table"><tbody>${trsHtml}</tbody></table>`;
const sel = editor.document.getSelection();
if (!sel.isCollapsed) {
editor.deleteRange(sel);