Skip to content

Commit 4f5deb5

Browse files
fix(spark): update example components and tests for typed CSS properties
- Updates `counter_final` and `notification_demo` examples in `packages/spark` to use valid `CssBorderRadius` and `CssTransform` constructors. - Removes unnecessary `css_types` imports in `packages/spark_css` tests. - Ensures all tests pass and code is formatted.
1 parent d3618af commit 4f5deb5

6 files changed

Lines changed: 11 additions & 15 deletions

File tree

packages/spark/example/lib/components/counter_final/counter_final_base.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CounterFinal {
3030
display: .block,
3131
padding: .all(.px(16)),
3232
border: CssBorder(width: .px(1), style: .solid, color: .hex('#e0e0e0')),
33-
borderRadius: .px(8),
33+
borderRadius: .all(.px(8)),
3434
maxWidth: .px(200),
3535
fontFamily: .raw('system-ui, -apple-system, sans-serif'),
3636
),
@@ -55,15 +55,15 @@ class CounterFinal {
5555
fontSize: .px(18),
5656
border: .none,
5757

58-
borderRadius: .px(4),
58+
borderRadius: .all(.px(4)),
5959
cursor: .pointer,
6060
transition: .raw('background-color 0.2s'),
6161
),
6262
'.decrement': .typed(backgroundColor: .hex('#f44336'), color: .white),
6363
'.decrement:hover': .typed(backgroundColor: .hex('#d32f2f')),
6464
'.increment': .typed(backgroundColor: .hex('#4caf50'), color: .white),
6565
'.increment:hover': .typed(backgroundColor: .hex('#388e3c')),
66-
'button:active': .typed(transform: 'scale(0.95)'),
66+
'button:active': .typed(transform: CssTransform.scale(0.95)),
6767
'button:disabled': .typed(
6868
opacity: CssNumber(0.6),
6969
cursor: .raw('not-allowed'),
@@ -80,7 +80,7 @@ class CounterFinal {
8080
width: .px(50),
8181
padding: .all(.px(4)),
8282
border: CssBorder(width: .px(1), style: .solid, color: .hex('#cccccc')),
83-
borderRadius: .px(4),
83+
borderRadius: .all(.px(4)),
8484
),
8585
});
8686

packages/spark/example/lib/components/notification_demo/notification_demo_base.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class NotificationDemo {
3434
display: .block,
3535
padding: .all(.px(24)),
3636
border: CssBorder(width: .px(1), style: .solid, color: .hex('#e0e0e0')),
37-
borderRadius: .px(12),
37+
borderRadius: .all(.px(12)),
3838
maxWidth: .px(500),
3939
fontFamily: .raw('system-ui, -apple-system, sans-serif'),
4040
),
@@ -48,7 +48,7 @@ class NotificationDemo {
4848
marginBottom: .px(16),
4949
padding: .all(.px(12)),
5050
backgroundColor: .hex('#f8f9fa'),
51-
borderRadius: .px(8),
51+
borderRadius: .all(.px(8)),
5252
),
5353
'.section-title': .typed(
5454
fontSize: .px(14),
@@ -60,7 +60,7 @@ class NotificationDemo {
6060
fontSize: .px(16),
6161
fontWeight: .bold,
6262
padding: .symmetric(.px(4), .px(8)),
63-
borderRadius: .px(4),
63+
borderRadius: .all(.px(4)),
6464
display: .inlineBlock,
6565
),
6666
'.granted': .typed(
@@ -86,12 +86,12 @@ class NotificationDemo {
8686
padding: .symmetric(.px(8), .px(16)),
8787
fontSize: .px(14),
8888
border: .none,
89-
borderRadius: .px(6),
89+
borderRadius: .all(.px(6)),
9090
cursor: .pointer,
9191
fontWeight: .bold,
9292
transition: .raw('background-color 0.2s, transform 0.1s'),
9393
),
94-
'button:active': .typed(transform: 'scale(0.97)'),
94+
'button:active': .typed(transform: CssTransform.scale(0.97)),
9595
'.btn-primary': .typed(backgroundColor: .hex('#2196f3'), color: .white),
9696
'.btn-primary:hover': .typed(backgroundColor: .hex('#1976d2')),
9797
'.btn-success': .typed(backgroundColor: .hex('#4caf50'), color: .white),
@@ -110,13 +110,13 @@ class NotificationDemo {
110110
padding: .all(.px(8)),
111111
fontSize: .px(14),
112112
border: CssBorder(width: .px(1), style: .solid, color: .hex('#cccccc')),
113-
borderRadius: .px(4),
113+
borderRadius: .all(.px(4)),
114114
),
115115
'.status-bar': .typed(
116116
marginTop: .px(12),
117117
padding: .all(.px(10)),
118118
backgroundColor: .hex('#e8f4fd'),
119-
borderRadius: .px(6),
119+
borderRadius: .all(.px(6)),
120120
fontSize: .px(13),
121121
color: .hex('#0c5460'),
122122
borderLeft: CssBorder(

packages/spark_css/test/css_background_position_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:spark_css/spark_css.dart';
2-
import 'package:spark_css/src/css_types/css_background_position.dart';
32
import 'package:test/test.dart';
43

54
void main() {

packages/spark_css/test/css_filter_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:spark_css/spark_css.dart';
2-
import 'package:spark_css/src/css_types/css_filter.dart';
32
import 'package:test/test.dart';
43

54
void main() {

packages/spark_css/test/css_flex_shorthand_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:spark_css/spark_css.dart';
2-
import 'package:spark_css/src/css_types/css_flex_shorthand.dart';
32
import 'package:test/test.dart';
43

54
void main() {

packages/spark_css/test/css_text_shadow_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import 'package:spark_css/spark_css.dart';
2-
import 'package:spark_css/src/css_types/css_text_shadow.dart';
32
import 'package:test/test.dart';
43

54
void main() {

0 commit comments

Comments
 (0)