jxFilterRules top-level property
Filtres composables : blur:, bri:, con:, gs:, hue:, sat:,
dsh:, grayscale, invert, sepia, filter-none, et leurs
équivalents d'arrière-plan bblur:, bbri:, bcon:, bgray:, bsat: (préfixe
b, via backdrop-filter).
Implementation
final List<JxRuleContract> jxFilterRules = [
_filterRule(
'blur',
'blur',
'--jx-blur',
'blur',
keywords: _blurScale,
fallback: _px,
),
_filterRule(
'brightness',
'bri',
'--jx-brightness',
'brightness',
fallback: _ratio,
),
_filterRule('contrast', 'con', '--jx-contrast', 'contrast', fallback: _ratio),
_filterRule(
'grayscale',
'gs',
'--jx-grayscale',
'grayscale',
fallback: _ratio,
),
_filterRule(
'hue-rotate',
'hue',
'--jx-hue-rotate',
'hue-rotate',
fallback: _deg,
allowNegative: true,
),
_filterRule('saturate', 'sat', '--jx-saturate', 'saturate', fallback: _ratio),
_filterRule(
'drop-shadow',
'dsh',
'--jx-drop-shadow',
'drop-shadow',
keywords: {
'sm': '0 1px 1px rgb(0 0 0 / 0.05)',
'md': '0 3px 3px rgb(0 0 0 / 0.12)',
'lg': '0 8px 10px rgb(0 0 0 / 0.15)',
'xl': '0 16px 24px rgb(0 0 0 / 0.18)',
'none': '0 0 #0000',
},
),
const JxStaticRule('filter-standalone', {
'grayscale': {'--jx-grayscale': 'grayscale(1)', 'filter': _filter},
'invert': {'--jx-invert': 'invert(1)', 'filter': _filter},
'sepia': {'--jx-sepia': 'sepia(1)', 'filter': _filter},
'filter-none': {'filter': 'none'},
}),
_filterRule(
'backdrop-blur',
'bblur',
'--jx-bd-blur',
'blur',
keywords: _blurScale,
fallback: _px,
backdrop: true,
),
_filterRule(
'backdrop-brightness',
'bbri',
'--jx-bd-brightness',
'brightness',
fallback: _ratio,
backdrop: true,
),
_filterRule(
'backdrop-contrast',
'bcon',
'--jx-bd-contrast',
'contrast',
fallback: _ratio,
backdrop: true,
),
_filterRule(
'backdrop-grayscale',
'bgray',
'--jx-bd-grayscale',
'grayscale',
fallback: _ratio,
backdrop: true,
),
_filterRule(
'backdrop-saturate',
'bsat',
'--jx-bd-saturate',
'saturate',
fallback: _ratio,
backdrop: true,
),
];