Skip to content

Commit f1e160a

Browse files
feat(spark_css): add CssBackgroundClip type
1 parent 8dd0840 commit f1e160a

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

packages/spark_css/lib/src/css_types/css_background_clip.dart

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,30 @@ sealed class CssBackgroundClip implements CssValue {
55
const CssBackgroundClip._();
66

77
/// The background extends to the outside edge of the border.
8-
static const CssBackgroundClip borderBox = _CssBackgroundClipKeyword('border-box');
8+
static const CssBackgroundClip borderBox = _CssBackgroundClipKeyword(
9+
'border-box',
10+
);
911

1012
/// The background extends to the outside edge of the padding.
11-
static const CssBackgroundClip paddingBox = _CssBackgroundClipKeyword('padding-box');
13+
static const CssBackgroundClip paddingBox = _CssBackgroundClipKeyword(
14+
'padding-box',
15+
);
1216

1317
/// The background extends to the outside edge of the content.
14-
static const CssBackgroundClip contentBox = _CssBackgroundClipKeyword('content-box');
18+
static const CssBackgroundClip contentBox = _CssBackgroundClipKeyword(
19+
'content-box',
20+
);
1521

1622
/// The background is clipped to the foreground text.
1723
static const CssBackgroundClip text = _CssBackgroundClipKeyword('text');
1824

1925
/// Multiple background-clip values for multiple background images.
20-
factory CssBackgroundClip.multiple(List<CssBackgroundClip> values) = _CssBackgroundClipMultiple;
26+
factory CssBackgroundClip.multiple(List<CssBackgroundClip> values) =
27+
_CssBackgroundClipMultiple;
2128

2229
/// CSS variable reference.
23-
factory CssBackgroundClip.variable(String varName) = _CssBackgroundClipVariable;
30+
factory CssBackgroundClip.variable(String varName) =
31+
_CssBackgroundClipVariable;
2432

2533
/// Raw CSS value escape hatch.
2634
factory CssBackgroundClip.raw(String value) = _CssBackgroundClipRaw;

packages/spark_css/test/css_background_clip_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ void main() {
3333
expect(CssBackgroundClip.global(CssGlobal.initial).toCss(), 'initial');
3434
expect(CssBackgroundClip.global(CssGlobal.unset).toCss(), 'unset');
3535
expect(CssBackgroundClip.global(CssGlobal.revert).toCss(), 'revert');
36-
expect(CssBackgroundClip.global(CssGlobal.revertLayer).toCss(), 'revert-layer');
36+
expect(
37+
CssBackgroundClip.global(CssGlobal.revertLayer).toCss(),
38+
'revert-layer',
39+
);
3740
});
3841
});
3942
}

0 commit comments

Comments
 (0)