Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 079b7d3

Browse files
committed
quick filters style
1 parent ac2fb6c commit 079b7d3

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

src/components/NavBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ export function NavBar(navBarProps: NavBarProps) {
123123
mr: 2,
124124
maxWidth: 40,
125125
marginRight: 1,
126+
padding: 0.5,
126127
}}
127128
>
128129
<MenuIcon />

src/components/reducers/QuickFilters.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const QuickFilters = (props: DataviewFiltersProps) => {
3434
return filters.conditions.length > 0 ? (
3535
<Stack direction="row" spacing={1} key="stack-quick-filters">
3636
{filters.conditions.map((condition, filterIndex) => {
37+
const { disabled } = condition as FilterGroupCondition;
3738
if ((condition as FilterGroupCondition).condition) {
3839
const label = (condition as FilterGroupCondition).label;
3940
return (
@@ -45,11 +46,15 @@ const QuickFilters = (props: DataviewFiltersProps) => {
4546
size="small"
4647
label={label ?? `filter-${filterIndex}`}
4748
sx={{
48-
backgroundColor: (condition as FilterGroupCondition).disabled
49-
? StyleVariables.BACKGROUND_SECONDARY
50-
: StyleVariables.BACKGROUND_MODIFIER_SUCCESS,
51-
boxShadow: `1px 1px 1px 1px ${StyleVariables.TEXT_NORMAL}`,
52-
color: StyleVariables.TEXT_NORMAL,
49+
backgroundColor: disabled
50+
? StyleVariables.INTERACTIVE_NORMAL
51+
: StyleVariables.TEXT_ACCENT,
52+
boxShadow: disabled ? StyleVariables.INPUT_SHADOW : "none",
53+
borderColor: disabled ? StyleVariables.LINK_COLOR : "none",
54+
color: disabled
55+
? StyleVariables.LINK_COLOR
56+
: StyleVariables.TEXT_NORMAL,
57+
borderRadius: "4px",
5358
}}
5459
/>
5560
</div>

src/helpers/Constants.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ export const StyleVariables = Object.freeze({
243243
TEXT_NORMAL: 'var(--text-normal)',
244244
TEXT_ACCENT_HOVER: 'var(--text-accent-hover)',
245245
TEXT_ACCENT: 'var(--text-accent)',
246+
LINK_COLOR: 'var(--link-color)',
247+
INTERACTIVE_NORMAL: 'var(--interactive-normal)',
248+
INPUT_SHADOW: 'var(--input-shadow)',
246249
});
247250

248251
export const SourceDataTypes = Object.freeze({

styles.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ div.database-plugin__td.data-input:hover {
8585
box-shadow: 0 0 1px 2px var(--text-accent-hover);
8686
}
8787

88+
/******************************************************
89+
* Inputs of cells
90+
******************************************************/
8891
.data-input {
8992
white-space: pre-wrap;
9093
border: none;
9194
padding: 0.5rem;
9295
color: var(--text-normal);
9396
font-size: 1rem;
94-
border-radius: 4px;
9597
resize: none;
9698
box-sizing: border-box;
9799
flex: 1 1 auto;

0 commit comments

Comments
 (0)