Skip to content

Commit

Permalink
UHF-8509: Import table styles into ckeditor.
Browse files Browse the repository at this point in the history
  • Loading branch information
khalima committed Oct 19, 2023
1 parent 9d7c637 commit 0b9f37d
Showing 1 changed file with 3 additions and 78 deletions.
81 changes: 3 additions & 78 deletions src/scss/ckeditor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,84 +68,9 @@
}

// 04_elements/_table.scss
// The CKEditor table element dom is quite different from what the end result will be once the node is saved
// so the styles needed quite a bit adjusting. When the table styles are updated remember to update these as well.
// Specificity required because of overlapping styles from CKEditor and hdbt_admin theme.
.ck-editor .ck-content figure.table {
margin: $spacing-double 0;
outline: 1px solid $color-black-60;
}

.ck-editor .ck-content figure.table table {
border: 0;
display: block;
margin: 0;
max-width: fit-content;
overflow-x: auto;
table-layout: fixed;
white-space: nowrap;
}

.ck-editor .ck-content figure.table > figcaption {
@include font('body');
background-color: $color-black;
border: 0;
color: $color-white;
padding: $spacing-double $spacing;
text-align: start;
}

.ck-editor .ck-content figure.table table thead th {
@include font('small');
background-color: $color-black;
color: $color-white;
font-weight: $font-weight-medium;
min-width: 140px;
padding: $spacing;
text-align: start;
vertical-align: middle;
white-space: normal;

p {
font-size: inherit;
font-weight: inherit;
margin: 0;
}
}

.ck-editor .ck-content figure.table table tbody tr,
.ck-editor .ck-content figure.table table tfoot tr {
border: 0;

&:hover,
&:active {
background-color: $color-black-5;
}

th,
td {
@include font('small');
color: $hdbt-color-black;
min-width: 140px;
text-align: start;
vertical-align: middle;
white-space: normal;
}

th {
background-color: $color-black;
color: $color-white;
font-weight: $font-weight-medium;
}

th p,
td p {
margin: 0;

& + p {
margin: $spacing 0 0;
}
}
// TODO The table is a mess because of source order in table.
.ck-editor .ck-content {
@import '04_elements/_table';
}

// hdbt_admin overrides for table styles.
Expand Down

0 comments on commit 0b9f37d

Please sign in to comment.