OLD | NEW |
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 import 'dart:sky'; | 7 import 'dart:sky'; |
8 | 8 |
9 import '../painting/text_style.dart'; | 9 import '../painting/text_style.dart'; |
10 | 10 |
11 // TODO(eseidel): Font weights are supposed to be language relative! | 11 // TODO(eseidel): Font weights are supposed to be language relative! |
12 // These values are for English-like text. | 12 // These values are for English-like text. |
13 class TextTheme { | 13 class TextTheme { |
14 TextTheme._(Color color54, Color color87) | 14 TextTheme._(Color color54, Color color87) |
15 : display4 = new TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, col
or: color54), | 15 : display4 = new TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, col
or: color54), |
16 display3 = new TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, col
or: color54), | 16 display3 = new TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, col
or: color54), |
17 display2 = new TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, col
or: color54), | 17 display2 = new TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, col
or: color54, height: 48.0 / 45.0), |
18 display1 = new TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, col
or: color54), | 18 display1 = new TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, col
or: color54, height: 40.0 / 34.0), |
19 headline = new TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, col
or: color87), | 19 headline = new TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, col
or: color87, height: 32.0 / 24.0), |
20 title = new TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, col
or: color87), | 20 title = new TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, col
or: color87, height: 28.0 / 20.0), |
21 subhead = new TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, col
or: color87), | 21 subhead = new TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, col
or: color87, height: 24.0 / 16.0), |
22 body2 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, col
or: color87), | 22 body2 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, col
or: color87, height: 24.0 / 14.0), |
23 body1 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, col
or: color87), | 23 body1 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, col
or: color87, height: 20.0 / 14.0), |
24 caption = new TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, col
or: color54), | 24 caption = new TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, col
or: color54), |
25 button = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, col
or: color87); | 25 button = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, col
or: color87); |
26 | 26 |
27 final TextStyle display4; | 27 final TextStyle display4; |
28 final TextStyle display3; | 28 final TextStyle display3; |
29 final TextStyle display2; | 29 final TextStyle display2; |
30 final TextStyle display1; | 30 final TextStyle display1; |
31 final TextStyle headline; | 31 final TextStyle headline; |
32 final TextStyle title; | 32 final TextStyle title; |
33 final TextStyle subhead; | 33 final TextStyle subhead; |
(...skipping 10 matching lines...) Expand all Loading... |
44 ); | 44 ); |
45 | 45 |
46 | 46 |
47 final TextTheme white = new TextTheme._( | 47 final TextTheme white = new TextTheme._( |
48 const Color(0xFF8A8A8A), | 48 const Color(0xFF8A8A8A), |
49 const Color(0xFFDEDEDE) | 49 const Color(0xFFDEDEDE) |
50 ); | 50 ); |
51 | 51 |
52 // TODO(abarth): Maybe this should be hard-coded in Scaffold? | 52 // TODO(abarth): Maybe this should be hard-coded in Scaffold? |
53 const String typeface = 'font-family: sans-serif'; | 53 const String typeface = 'font-family: sans-serif'; |
| 54 |
| 55 const TextStyle error = const TextStyle( |
| 56 color: const Color(0xD0FF0000), |
| 57 fontFamily: 'monospace', |
| 58 fontSize: 48.0, |
| 59 fontWeight: FontWeight.w900, |
| 60 textAlign: TextAlign.right, |
| 61 decoration: underline, |
| 62 decorationColor: const Color(0xFFFF00), |
| 63 decorationStyle: TextDecorationStyle.double |
| 64 ); |
| 65 |
OLD | NEW |