Skip to content

Commit 9355a20

Browse files
committed
chore: Update styles
1 parent efb6b2c commit 9355a20

2 files changed

Lines changed: 98 additions & 32 deletions

File tree

example/lib/app.dart

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,62 @@ class App extends StatelessComponent {
1111
return div(
1212
styles: Styles(
1313
display: Display.flex,
14-
margin: Spacing.symmetric(horizontal: Unit.pixels(75)),
14+
minHeight: Unit.vh(100),
1515
flexDirection: FlexDirection.column,
16-
fontFamily: FontFamily.variable('Ink Free Regular'),
16+
color: Color('#111827'),
17+
fontFamily: FontFamily('Inter, system-ui, sans-serif'),
18+
backgroundColor: Color('#f9fafb'),
1719
),
1820
classes: 'main',
1921
[
20-
h2(
22+
header(
2123
styles: Styles(
22-
width: Unit.percent(100),
23-
margin: Spacing.symmetric(vertical: .pixels(20)),
24-
flex: Flex.shrink(1),
24+
padding: Spacing.symmetric(vertical: Unit.pixels(16)),
2525
textAlign: TextAlign.center,
2626
),
27-
[.text('Dart Romanize')],
28-
),
29-
div(
30-
styles: Styles(flex: Flex.grow(1)),
3127
[
32-
const Home(),
28+
h1(
29+
styles: Styles(
30+
margin: Spacing.zero,
31+
color: Color('#111827'),
32+
fontSize: Unit.rem(2),
33+
fontWeight: FontWeight.w700,
34+
),
35+
[
36+
.text('Dart Romanize'),
37+
p(
38+
styles: Styles(
39+
margin: Spacing.only(top: Unit.pixels(8)),
40+
color: Color('#6b7280'),
41+
fontSize: Unit.rem(1),
42+
),
43+
[.text('Convert text to Romanized form instantly')],
44+
),
45+
],
46+
),
3347
],
3448
),
49+
div(
50+
styles: Styles(
51+
width: Unit.percent(100),
52+
maxWidth: Unit.pixels(1200),
53+
padding: Spacing.all(Unit.pixels(32)),
54+
margin: Spacing.symmetric(horizontal: Unit.auto),
55+
flex: Flex.grow(1),
56+
),
57+
[const Home()],
58+
),
59+
footer(
60+
styles: Styles(
61+
padding: Spacing.all(Unit.pixels(16)),
62+
border: Border.only(top: BorderSide(color: Color('#e5e7eb'))),
63+
color: Colors.black.withOpacity(0.6),
64+
textAlign: TextAlign.center,
65+
fontSize: Unit.rem(0.875),
66+
backgroundColor: Colors.white,
67+
),
68+
[.text('Built with Jaspr & Romanize')],
69+
),
3570
],
3671
);
3772
}

example/lib/pages/home.dart

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,46 +16,77 @@ class _HomeState extends State<Home> {
1616

1717
@override
1818
Component build(BuildContext context) {
19+
final textareaStyle = Styles(
20+
width: Unit.percent(100),
21+
height: Unit.pixels(300),
22+
padding: Spacing.all(Unit.pixels(16)),
23+
boxSizing: BoxSizing.borderBox,
24+
border: Border.all(color: Color('#d1d5db')),
25+
radius: BorderRadius.circular(Unit.pixels(25)),
26+
outline: Outline.unset,
27+
// fontFamily: FontFamily.monospace,
28+
shadow: BoxShadow(
29+
color: Color.rgba(0, 0, 0, 0.05),
30+
blur: Unit.pixels(2),
31+
offsetX: Unit.zero,
32+
offsetY: Unit.pixels(1),
33+
),
34+
// resize: Resize.none,
35+
fontSize: Unit.rem(1),
36+
backgroundColor: Colors.white,
37+
raw: {
38+
'resize': 'none',
39+
},
40+
);
41+
42+
final sectionStyle = Styles(
43+
display: Display.flex,
44+
// flexBasis: FlexBasis(Unit.pixels(400)),
45+
flexDirection: FlexDirection.column,
46+
gap: Gap.all(Unit.pixels(12)),
47+
flex: Flex.grow(1),
48+
);
49+
50+
final labelStyle = Styles(
51+
margin: Spacing.zero,
52+
color: Color('#374151'),
53+
fontSize: Unit.rem(1.125),
54+
fontWeight: FontWeight.w600,
55+
);
56+
1957
return div(
2058
styles: Styles(
2159
display: Display.flex,
22-
padding: Spacing.all(Unit.pixels(20)),
23-
flexDirection: FlexDirection.row,
24-
alignItems: AlignItems.start,
25-
gap: Gap(row: Unit.pixels(60), column: Unit.pixels(60)),
60+
width: Unit.percent(100),
61+
flexWrap: FlexWrap.wrap,
62+
gap: Gap.all(Unit.pixels(32)),
2663
),
2764
[
28-
div(styles: Styles(flex: Flex.basis(Unit.percent(50))), [
29-
h3([.text('Input')]),
65+
div(styles: sectionStyle, [
66+
h3(styles: labelStyle, [.text('Input')]),
3067
textarea(
3168
placeholder: 'Type your text here...',
3269
onInput: (text) => setState(() => _text = text),
3370
rows: 15,
3471
required: true,
3572
spellCheck: SpellCheck.isFalse,
36-
styles: Styles(
37-
width: Unit.percent(100),
38-
height: Unit.percent(100),
39-
flex: Flex.grow(1),
40-
raw: {'resize': 'none'},
41-
),
73+
styles: textareaStyle,
4274
[.text(_text)],
4375
),
4476
]),
45-
div(styles: Styles(flex: Flex.basis(Unit.percent(50))), [
46-
h3(styles: Styles(textAlign: TextAlign.left), [.text('Output')]),
77+
div(styles: sectionStyle, [
78+
h3(styles: labelStyle, [.text('Output')]),
4779
textarea(
4880
placeholder: 'Type your text here...',
49-
onInput: (text) => setState(() => _text = text),
81+
// onInput: (text) => setState(() => _text = text), // Readonly, no input needed
5082
rows: 15,
5183
readonly: true,
52-
required: true,
5384
spellCheck: SpellCheck.isFalse,
54-
styles: Styles(
55-
width: Unit.percent(100),
56-
height: Unit.percent(100),
57-
flex: Flex.grow(1),
58-
raw: {'resize': 'none'},
85+
styles: textareaStyle.combine(
86+
Styles(
87+
color: Color('#4b5563'),
88+
backgroundColor: Color('#f9fafb'),
89+
),
5990
),
6091
[.text(_romanized)],
6192
),

0 commit comments

Comments
 (0)