Skip to content

Commit

Permalink
Improve styling
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoshino committed Feb 2, 2025
1 parent 90a5469 commit 3179e74
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 41 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/assets/shared/asset-preview.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,22 @@
border-width: 1px;
border-style: solid;
border-color: transparent;
padding: var(--tile-padding, 8px);
padding: var(--tile-padding, 12px);
:global(.sui.icon) {
font-size: 48px;
}
}
&.icon {
width: 32px;
height: 32px;
border-radius: var(--sui-control-medium-border-radius);
width: var(--icon-size, 32px);
height: var(--icon-size, 32px);
}
&.tile,
&.icon {
overflow: hidden;
border-radius: var(--sui-control-medium-border-radius);
aspect-ratio: 1 / 1;
}
Expand Down
9 changes: 1 addition & 8 deletions src/lib/components/common/list-container.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,10 @@
:global(:is(.grid-view, .list-view)) {
display: block;
padding: 0 16px 16px;
height: 100%;
overflow-y: auto;
}
:global(.grid-view) {
padding: 16px;
}
:global(.list-view) {
padding: 8px 16px;
}
}
}
</style>
41 changes: 12 additions & 29 deletions src/lib/components/common/listing-grid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,6 @@
height: auto;
text-align: left;
&:focus-visible {
outline-color: transparent;
:global(.preview) {
outline-offset: -2px;
outline-width: 2px !important;
outline-style: solid;
outline-color: var(--sui-primary-accent-color-light);
}
}
:global(.grid-cell) {
display: block;
}
Expand Down Expand Up @@ -111,6 +100,8 @@
}
.list-view {
--icon-size: 36px;
:global([role='grid']) {
:global(.row-group) {
:global(.row-group-caption + .grid-row) {
Expand All @@ -127,16 +118,8 @@
}
:global([role='row']) {
outline-offset: -2px;
outline-width: 2px !important;
outline-style: solid;
outline-color: transparent;
transition-property: background-color, outline-color;
transition-duration: 200ms;
&:focus {
outline-color: var(--sui-primary-accent-color-light);
}
}
:global([role='row'][tabindex]) {
Expand All @@ -152,14 +135,18 @@
}
:global([role='gridcell']) {
vertical-align: middle;
overflow: hidden;
text-overflow: ellipsis;
padding: 0 16px 0 0;
height: 40px;
padding: 0 8px;
max-width: 100%;
color: var(--sui-secondary-foreground-color);
white-space: nowrap;
text-overflow: ellipsis;
vertical-align: middle;
&:first-child {
padding-left: 16px;
}
:global(.label) {
overflow: hidden;
Expand All @@ -170,16 +157,12 @@
:global(.grid-cell.image:empty::before) {
display: block;
border-radius: var(--sui-control-medium-border-radius);
width: 32px;
height: 32px;
width: var(--icon-size);
height: var(--icon-size);
background-color: var(--sui-secondary-background-color);
content: '';
}
:global([role='gridcell']:last-child) {
padding-right: 16px;
}
:global([role='row'] [role='gridcell']) {
border-width: 1px 0 0;
border-color: var(--sui-secondary-border-color);
Expand All @@ -190,6 +173,7 @@
}
:global([role='gridcell'].checkbox) {
padding-left: 8px;
width: 44px;
}
Expand All @@ -199,7 +183,6 @@
}
:global([role='gridcell'].image) {
padding: 0 8px;
width: 48px;
}
}
Expand Down

0 comments on commit 3179e74

Please sign in to comment.