Skip to content

Commit

Permalink
đź’„ (#114): add table css variables
Browse files Browse the repository at this point in the history
Signed-off-by: Vinicius Reis <[email protected]>
Signed-off-by: nextcloud-command <[email protected]>
  • Loading branch information
Vinicius Reis authored and nextcloud-command committed Mar 30, 2022
1 parent 563c5d7 commit c7abbec
Show file tree
Hide file tree
Showing 13 changed files with 40 additions and 29 deletions.
33 changes: 22 additions & 11 deletions css/prosemirror.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use "sass:selector";

/* Document rendering styles */
div.ProseMirror {
margin-top: 44px;
Expand Down Expand Up @@ -252,7 +254,16 @@ div.ProseMirror {
}
}

// TODO: create new css variables to improve the theming capability.
// table variables
@at-root :root {
--table-color-border: var(--color-border);
--table-color-heading: var(--color-text-maxcontrast);
--table-color-heading-border: var(--color-border-dark);
--table-color-background: var(--color-main-background);
--table-color-background-hover: var(--color-primary-light);
--table-border-radius: var(--border-radius);
}

table {
border-spacing: 0;
width: calc(100% - 50px);
Expand All @@ -265,12 +276,12 @@ div.ProseMirror {


td, th {
border: 1px solid var(--color-border);
border: 1px solid var(--table-color-border);
border-left: 0;
vertical-align: top;
max-width: 100%;
&:first-child {
border-left: 1px solid var(--color-border);
border-left: 1px solid var(--table-color-border);
}
}
td {
Expand All @@ -281,24 +292,24 @@ div.ProseMirror {
th {
padding: 0 0 0 0.75em;
font-weight: normal;
border-bottom-color: var(--color-border-dark);
color: var(--color-text-maxcontrast);
border-bottom-color: var(--table-color-heading-border);
color: var(--table-color-heading);
}
tr {
background-color: var(--color-main-background);
background-color: var(--table-color-background);
&:hover, &:active, &:focus {
background-color: var(--color-primary-light);
background-color: var(--table-color-background-hover);
}
}

tr:first-child {
th:first-child { border-top-left-radius: var(--border-radius); }
th:last-child { border-top-right-radius: var(--border-radius); }
th:first-child { border-top-left-radius: var(--table-border-radius); }
th:last-child { border-top-right-radius: var(--table-border-radius); }
}

tr:last-child {
td:first-child { border-bottom-left-radius: var(--border-radius); }
td:last-child { border-bottom-right-radius: var(--border-radius); }
td:first-child { border-bottom-left-radius: var(--table-border-radius); }
td:last-child { border-bottom-right-radius: var(--table-border-radius); }
}

}
Expand Down
4 changes: 2 additions & 2 deletions js/editor-collab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor-collab.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

0 comments on commit c7abbec

Please sign in to comment.