Skip to content

Commit

Permalink
[atable] Fix atable gray border (#201)
Browse files Browse the repository at this point in the history
* added left border to first cell of all atable rows for expanded, default, and pinned

* reduced row height and added cell change variable (light blue)

* added changelog

* updated gray border to match aform. Added border to expanded row

* used darker gray for table borders. Added thin gray left border to expanded content

* updated aform to use darker gray border to match atable border style

---------

Co-authored-by: Rohan Bansal <[email protected]>
  • Loading branch information
crabinak and Rohan Bansal authored Dec 13, 2024
1 parent 809a481 commit c777f22
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion atable/src/components/ACell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const cellStyle = computed((): CSSProperties => {
return {
textAlign,
width: cellWidth,
backgroundColor: !cellModified.value ? 'inherit' : 'var(--sc-cell-modified)',
backgroundColor: !cellModified.value ? 'inherit' : 'var(--sc-cell-changed-color)',
fontWeight: !cellModified.value ? 'inherit' : 'bold',
paddingLeft: store.getIndent(colIndex, store.display[rowIndex]?.indent),
}
Expand Down
12 changes: 8 additions & 4 deletions atable/src/components/AExpansionRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,21 @@ if (addNavigation) {
.expandable-row {
border-top: 1px solid var(--sc-row-border-color);
height: var(--sc-atable-row-height);
border-left: 4px solid var(--sc-row-border-color);
display: flex;
}
.expandable-row > td:first-child {
border-left: 4px solid var(--sc-row-border-color);
}
.expanded-row {
border-bottom: 1px solid var(--sc-row-border-color);
border-top: 1px solid var(--sc-row-border-color);
display: flex;
border-left: 2px solid var(--sc-row-border-color);
}
.expanded-row-content {
.expandable-row:last-child {
border-bottom: 1px solid var(--sc-row-border-color);
}
.expanded-row-content {
border-top: 1px solid var(--sc-row-border-color);
padding: 1.5rem;
}
Expand Down
4 changes: 4 additions & 0 deletions atable/src/components/ARow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ if (addNavigation) {
background-color: white;
}
.table-row > td:first-child {
border-left: 4px solid var(--sc-row-border-color);
}
.list-index {
color: var(--sc-header-text-color);
font-weight: bold;
Expand Down
1 change: 1 addition & 0 deletions atable/src/components/ATable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ td.sticky-index {
box-sizing: border-box;
table-layout: auto;
width: auto;
/* border-left:4px solid var(--sc-form-border); */
}
.atable th {
border-width: 0px;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/atable",
"comment": "minor style updates for Atable",
"type": "patch"
}
],
"packageName": "@stonecrop/atable"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@stonecrop/themes",
"comment": "added cell change color variable",
"type": "patch"
}
],
"packageName": "@stonecrop/themes"
}
6 changes: 1 addition & 5 deletions examples/atable/default.story.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,7 @@ const full_width_table = ref({
})
</script>

<style>
:root {
--sc-cell-modified: yellow;
}
</style>
<style></style>

<!-- enter documentation here -->
<docs lang="md"></docs>
6 changes: 3 additions & 3 deletions themes/default/_variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
--sc-input-border-color: var(--sc-gray-20);
--sc-input-label-color: var(--sc-gray-60);
--sc-required-border: #e63c28;
--sc-cell-modified: #ffffb1;
--sc-form-border: var(--sc-gray-5);
--sc-cell-changed-color: #d8edff;
--sc-form-border: var(--sc-gray-20);
--sc-form-background: #ffffff;
--sc-input-field-background: #ffffff;
--sc-input-field-disabled-background: var(--sc-gray-5);
Expand All @@ -52,7 +52,7 @@
--sc-atable-font-family: 'Arimo', sans-serif;

/* TABLE */
--sc-atable-row-padding: 5px;
--sc-atable-row-padding: 0.125rem;
--sc-atable-row-height: 1.5em;
--sc-atable-cell-border-width: 2px;

Expand Down

0 comments on commit c777f22

Please sign in to comment.