jxGradientRules top-level constant
Dégradés : grad:to-r (ou un angle, grad:45, grad:[135deg]),
grad-radial, grad-conic, et les couleurs from:, via:, to:.
Implementation
const List<JxRuleContract> jxGradientRules = [
JxValueRule(
'linear-gradient',
properties: {
'grad': ['background-image'],
},
keywords: {
'to-t': 'to top',
'to-tr': 'to top right',
'to-r': 'to right',
'to-br': 'to bottom right',
'to-b': 'to bottom',
'to-bl': 'to bottom left',
'to-l': 'to left',
'to-tl': 'to top left',
},
fallback: _deg,
template: 'linear-gradient({}, $_stops)',
),
JxStaticRule('gradient-standalone', {
'grad-radial': {'background-image': 'radial-gradient($_stops)'},
'grad-conic': {'background-image': 'conic-gradient($_stops)'},
}),
JxValueRule(
'gradient-stops',
properties: {
'from': ['--jx-from'],
'to': ['--jx-to'],
},
themeCategory: JxThemeCategory.colors,
keywords: {'transparent': 'transparent', 'current': 'currentColor'},
fallback: _hexColor,
),
JxValueRule(
'gradient-via',
properties: {
'via': ['--jx-via'],
},
themeCategory: JxThemeCategory.colors,
keywords: {'transparent': 'transparent', 'current': 'currentColor'},
fallback: _hexColor,
template: '{},',
),
];