Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: sky/sdk/lib/framework/theme2/typography.dart

Issue 1176133002: Add support for text styles - Work In Progress (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // See http://www.google.com/design/spec/style/typography.html 5 // See http://www.google.com/design/spec/style/typography.html
6 6
7 const String _display4 = 'font-size: 112px; font-weight: 300'; 7 const TextStyle _display4 = const TextStyle(fontSize: '112px', fontWeight: '300' );
8 const String _display3 = 'font-size: 56px; font-weight: 400'; 8 const TextStyle _display3 = const TextStyle(fontSize: '56px', fontWeight: '400' );
9 const String _display2 = 'font-size: 45px; font-weight: 400'; 9 const TextStyle _display2 = const TextStyle(fontSize: '45px', fontWeight: '400' );
10 const String _display1 = 'font-size: 34px; font-weight: 400'; 10 const TextStyle _display1 = const TextStyle(fontSize: '34px', fontWeight: '400' );
11 const String _headline = 'font-size: 24px; font-weight: 400'; 11 const TextStyle _headline = const TextStyle(fontSize: '24px', fontWeight: '400' );
12 const String _title = 'font-size: 20px; font-weight: 500'; 12 const TextStyle _title = const TextStyle(fontSize: '20px', fontWeight: '500' );
13 const String _subhead = 'font-size: 16px; font-weight: 400'; 13 const TextStyle _subhead = const TextStyle(fontSize: '16px', fontWeight: '400' );
14 const String _body2 = 'font-size: 14px; font-weight: 500'; 14 const TextStyle _body2 = const TextStyle(fontSize: '14px', fontWeight: '500' );
15 const String _body1 = 'font-size: 14px; font-weight: 400'; 15 const TextStyle _body1 = const TextStyle(fontSize: '14px', fontWeight: '400' );
16 const String _caption = 'font-size: 12px; font-weight: 400'; 16 const TextStyle _caption = const TextStyle(fontSize: '12px', fontWeight: '400' );
17 const String _button = 'font-size: 14px; font-weight: 500'; 17 const TextStyle _button = const TextStyle(fontSize: '14px', fontWeight: '500' );
18 18
19 // TODO(hansmuller) specify inherited values explicitly, like inherit: _display4
19 class _Black { 20 class _Black {
20 final String display4 = 'color: #757575; ${_display4}'; // 54% 21 final TextStyle display4 = const TextStyle(color: const Color(0x757575), fontS ize: _display4.fontSize, fontWeight: _display4.fontWeight); // 54%
21 final String display3 = 'color: #757575; ${_display3}'; // 54% 22 final TextStyle display4 = const TextStyle(color: const Color(0x757575), fontS ize: _display4.fontSize, fontWeight: _display4.fontWeight); // 54%
22 final String display2 = 'color: #757575; ${_display2}'; // 54% 23 final TextStyle display3 = const TextStyle(color: const Color(0x757575), fontS ize: _display3.fontSize, fontWeight: _display3.fontWeight); // 54%
23 final String display1 = 'color: #757575; ${_display1}'; // 54% 24 final TextStyle display2 = const TextStyle(color: const Color(0x757575), fontS ize: _display2.fontSize, fontWeight: _display2.fontWeight); // 54%
24 final String headline = 'color: #212121; ${_headline}'; // 87% 25 final TextStyle display1 = const TextStyle(color: const Color(0x757575), fontS ize: _display1.fontSize, fontWeight: _display1.fontWeight); // 54%
25 final String title = 'color: #212121; ${_title}'; // 87% 26 final TextStyle headline = const TextStyle(color: const Color(0x212121), fontS ize: _headline.fontSize, fontWeight: _headline.fontWeight); // 87%
26 final String subhead = 'color: #212121; ${_subhead}'; // 87% 27 final TextStyle title = const TextStyle(color: const Color(0x212121), fontS ize: _title.fontSize, fontWeight: _title.fontWeight); // 87%
27 final String body2 = 'color: #212121; ${_body2}'; // 87% 28 final TextStyle subhead = const TextStyle(color: const Color(0x212121), fontS ize: _subhead.fontSize, fontWeight: _subhead.fontWeight); // 87%
28 final String body1 = 'color: #212121; ${_body1}'; // 87% 29 final TextStyle body2 = const TextStyle(color: const Color(0x212121), fontS ize: _body2.fontSize, fontWeight: _body2.fontWeight); // 87%
29 final String caption = 'color: #757575; ${_caption}'; // 54% 30 final TextStyle body1 = const TextStyle(color: const Color(0x212121), fontS ize: _body1.fontSize, fontWeight: _body1.fontWeight); // 87%
30 final String button = 'color: #212121; ${_button}'; // 87% 31 final TextStyle caption = const TextStyle(color: const Color(0x757575), fontS ize: _caption.fontSize, fontWeight: _caption.fontWeight); // 54%
32 final TextStyle button = const TextStyle(color: const Color(0x212121), fontS ize: _button.fontSize, fontWeight: _button.fontWeight); // 87%
31 33
32 const _Black(); 34 const _Black();
33 } 35 }
34 36
35 const _Black black = const _Black(); 37 const _Black black = const _Black();
36 38
37 class _White { 39 class _White {
38 final String display4 = 'color: #8A8A8A; ${_display4}'; // 54% 40 final TextStyle display4 = const TextStyle(color: const Color(0x8A8A8A), _disp lay4); // 54%
39 final String display3 = 'color: #8A8A8A; ${_display3}'; // 54% 41 final TextStyle display3 = const TextStyle(color: const Color(0x8A8A8A), _disp lay3); // 54%
40 final String display2 = 'color: #8A8A8A; ${_display2}'; // 54% 42 final TextStyle display2 = const TextStyle(color: const Color(0x8A8A8A), _disp lay2); // 54%
41 final String display1 = 'color: #8A8A8A; ${_display1}'; // 54% 43 final TextStyle display1 = const TextStyle(color: const Color(0x8A8A8A), _disp lay1); // 54%
42 final String headline = 'color: #DEDEDE; ${_headline}'; // 87% 44 final TextStyle headline = const TextStyle(color: const Color(0xDEDEDE), _head line); // 87%
43 final String title = 'color: #DEDEDE; ${_title}'; // 87% 45 final TextStyle title = const TextStyle(color: const Color(0xDEDEDE), _titl e); // 87%
44 final String subhead = 'color: #DEDEDE; ${_subhead}'; // 87% 46 final TextStyle subhead = const TextStyle(color: const Color(0xDEDEDE), _subh ead); // 87%
45 final String body2 = 'color: #DEDEDE; ${_body2}'; // 87% 47 final TextStyle body2 = const TextStyle(color: const Color(0xDEDEDE), _body 2); // 87%
46 final String body1 = 'color: #DEDEDE; ${_body1}'; // 87% 48 final TextStyle body1 = const TextStyle(color: const Color(0xDEDEDE), _body 1); // 87%
47 final String caption = 'color: #8A8A8A; ${_caption}'; // 54% 49 final TextStyle caption = const TextStyle(color: const Color(0x8A8A8A), _capt ion); // 54%
48 final String button = 'color: #DEDEDE; ${_button}'; // 87% 50 final String button = const TextStyle(color: const Color(0xDEDEDE), _butt on); // 87%
49 51
50 const _White(); 52 const _White();
51 } 53 }
52 54
53 const _White white = const _White(); 55 const _White white = const _White();
54 56
55 // TODO(abarth): Maybe this should be hard-coded in Scaffold? 57 // TODO(abarth): Maybe this should be hard-coded in Scaffold?
56 const String typeface = 'font-family: sans-serif'; 58 const String typeface = 'font-family: sans-serif';
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698