Commit f3e07210 authored by Hixie's avatar Hixie

Make typography.white and typography.black constants.

parent df88d38b
...@@ -16,8 +16,8 @@ class ThemeData { ...@@ -16,8 +16,8 @@ class ThemeData {
Map<int, Color> primarySwatch, Map<int, Color> primarySwatch,
Color accentColor, Color accentColor,
this.accentColorBrightness: ThemeBrightness.dark, this.accentColorBrightness: ThemeBrightness.dark,
typography.TextTheme text }) typography.TextTheme text
: this.brightness = brightness, }): this.brightness = brightness,
this.primarySwatch = primarySwatch, this.primarySwatch = primarySwatch,
primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightness.dark, primaryColorBrightness = primarySwatch == null ? brightness : ThemeBrightness.dark,
canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colors.Grey[50], canvasColor = brightness == ThemeBrightness.dark ? colors.Grey[850] : colors.Grey[50],
......
...@@ -12,18 +12,34 @@ import 'package:sky/painting/text_style.dart'; ...@@ -12,18 +12,34 @@ import 'package:sky/painting/text_style.dart';
// TODO(jackson): Baseline should be language relative! // TODO(jackson): Baseline should be language relative!
// These values are for English-like text. // These values are for English-like text.
class TextTheme { class TextTheme {
TextTheme._(Color color54, Color color87)
: display4 = new TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: color54, textBaseline: TextBaseline.alphabetic), // The two colours used here are 54% and 87%, respectively, of the base color (black or white)
display3 = new TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: color54, textBaseline: TextBaseline.alphabetic),
display2 = new TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: color54, height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic), const TextTheme._black()
display1 = new TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: color54, height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic), : display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: const Color(0xFF757575), textBaseline: TextBaseline.alphabetic),
headline = new TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: color87, height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic), display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: const Color(0xFF757575), textBaseline: TextBaseline.alphabetic),
title = new TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: color87, height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic), display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: const Color(0xFF757575), height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
subhead = new TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: color87, height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic), display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: const Color(0xFF757575), height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
body2 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: color87, height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic), headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: const Color(0xFF212121), height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
body1 = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: color87, height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic), title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: const Color(0xFF212121), height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
caption = new TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: color54, textBaseline: TextBaseline.alphabetic), subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: const Color(0xFF212121), height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
button = new TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: color87, textBaseline: TextBaseline.alphabetic); body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: const Color(0xFF212121), height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: const Color(0xFF212121), height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: const Color(0xFF757575), textBaseline: TextBaseline.alphabetic),
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: const Color(0xFF212121), textBaseline: TextBaseline.alphabetic);
const TextTheme._white()
: display4 = const TextStyle(fontSize: 112.0, fontWeight: FontWeight.w100, color: const Color(0xFF8A8A8A), textBaseline: TextBaseline.alphabetic),
display3 = const TextStyle(fontSize: 56.0, fontWeight: FontWeight.w400, color: const Color(0xFF8A8A8A), textBaseline: TextBaseline.alphabetic),
display2 = const TextStyle(fontSize: 45.0, fontWeight: FontWeight.w400, color: const Color(0xFF8A8A8A), height: 48.0 / 45.0, textBaseline: TextBaseline.alphabetic),
display1 = const TextStyle(fontSize: 34.0, fontWeight: FontWeight.w400, color: const Color(0xFF8A8A8A), height: 40.0 / 34.0, textBaseline: TextBaseline.alphabetic),
headline = const TextStyle(fontSize: 24.0, fontWeight: FontWeight.w400, color: const Color(0xFFDEDEDE), height: 32.0 / 24.0, textBaseline: TextBaseline.alphabetic),
title = const TextStyle(fontSize: 20.0, fontWeight: FontWeight.w500, color: const Color(0xFFDEDEDE), height: 28.0 / 20.0, textBaseline: TextBaseline.alphabetic),
subhead = const TextStyle(fontSize: 16.0, fontWeight: FontWeight.w400, color: const Color(0xFFDEDEDE), height: 24.0 / 16.0, textBaseline: TextBaseline.alphabetic),
body2 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: const Color(0xFFDEDEDE), height: 24.0 / 14.0, textBaseline: TextBaseline.alphabetic),
body1 = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400, color: const Color(0xFFDEDEDE), height: 20.0 / 14.0, textBaseline: TextBaseline.alphabetic),
caption = const TextStyle(fontSize: 12.0, fontWeight: FontWeight.w400, color: const Color(0xFF8A8A8A), textBaseline: TextBaseline.alphabetic),
button = const TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500, color: const Color(0xFFDEDEDE), textBaseline: TextBaseline.alphabetic);
final TextStyle display4; final TextStyle display4;
final TextStyle display3; final TextStyle display3;
...@@ -36,19 +52,12 @@ class TextTheme { ...@@ -36,19 +52,12 @@ class TextTheme {
final TextStyle body1; final TextStyle body1;
final TextStyle caption; final TextStyle caption;
final TextStyle button; final TextStyle button;
}
}
final TextTheme black = new TextTheme._(
const Color(0xFF757575),
const Color(0xFF212121)
);
final TextTheme white = new TextTheme._( const TextTheme black = const TextTheme._black();
const Color(0xFF8A8A8A), const TextTheme white = const TextTheme._white();
const Color(0xFFDEDEDE)
);
// TODO(abarth): Maybe this should be hard-coded in Scaffold? // TODO(abarth): Maybe this should be hard-coded in Scaffold?
const String typeface = 'font-family: sans-serif'; const String typeface = 'font-family: sans-serif';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment