Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Commit

Permalink
Follow-up fixes for the styling page
Browse files Browse the repository at this point in the history
Fixes the following issues with the styling page:
* The table header background wasn't themed correctly.
* The filters looked weird on smaller screens.
* Filtering was case-sensitive.
  • Loading branch information
crisbeto committed Oct 31, 2024
1 parent b82bc86 commit 8d7071c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/app/pages/component-viewer/token-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ thead {
position: sticky;
top: 0;
left: 0;
background: #fdfbff;
background: var(--mat-sys-surface);
z-index: 1;
}

Expand All @@ -19,10 +19,8 @@ thead {
align-items: center;
margin: 24px 0;
width: 100%;
}

.filters mat-form-field {
margin-right: 16px;
flex-wrap: wrap;
gap: 16px;
}

.name-field {
Expand Down
4 changes: 2 additions & 2 deletions src/app/pages/component-viewer/token-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ export class TokenTable {
protected typeFilter = signal<TokenType | null>(null);
protected types: TokenType[] = ['base', 'color', 'typography', 'density'];
protected filteredTokens = computed(() => {
const name = this.nameFilter().trim();
const name = this.nameFilter().trim().toLowerCase();
const typeFilter = this.typeFilter();

return this.tokens().filter(token =>
(!name || token.overridesName.includes(name)) &&
(!name || token.overridesName.toLowerCase().includes(name)) &&
(!typeFilter || token.type === typeFilter));
});

Expand Down

0 comments on commit 8d7071c

Please sign in to comment.