From 530966e05a5c8258f5d8bc67ab3f1a3c366ae32d Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 14 Feb 2020 11:27:04 +1300 Subject: [PATCH 1/9] Updated css break points to align with spec --- packages/mdc-layout-grid/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mdc-layout-grid/_variables.scss b/packages/mdc-layout-grid/_variables.scss index a8886416361..9e3eae2aaa1 100644 --- a/packages/mdc-layout-grid/_variables.scss +++ b/packages/mdc-layout-grid/_variables.scss @@ -20,7 +20,7 @@ $breakpoints: ( desktop: 840px, - tablet: 480px, + tablet: 600px, phone: 0px ) !default; From eb062e6acd083654e56052170ed11ce6893a4e21 Mon Sep 17 00:00:00 2001 From: Boris Damevin Date: Tue, 18 Feb 2020 01:38:08 +0100 Subject: [PATCH 2/9] refactor: @use position --- packages/mdc-base/_mixins.scss | 3 ++- packages/mdc-typography/_functions.scss | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/mdc-base/_mixins.scss b/packages/mdc-base/_mixins.scss index 293e5c8d632..74839cc4257 100644 --- a/packages/mdc-base/_mixins.scss +++ b/packages/mdc-base/_mixins.scss @@ -1,4 +1,3 @@ -@use "sass:list"; // // Copyright 2018 Google Inc. // @@ -21,6 +20,8 @@ // THE SOFTWARE. // +@use "sass:list"; + // This variable is not intended to be overridden externally; it uses !default to avoid being reset // every time this file is imported. $styles-emitted_: () !default; diff --git a/packages/mdc-typography/_functions.scss b/packages/mdc-typography/_functions.scss index e0c1339f15e..c748a09bfd9 100644 --- a/packages/mdc-typography/_functions.scss +++ b/packages/mdc-typography/_functions.scss @@ -1,6 +1,3 @@ -@use "sass:map"; -@use "sass:string"; - // // Copyright 2018 Google Inc. // @@ -23,6 +20,9 @@ // THE SOFTWARE. // +@use "sass:map"; +@use "sass:string"; + @function get-global-variable_($style) { @if $style == "headline1" { @return $mdc-typography-styles-headline1; From 6a56f387c498e80cbac1cac5de6b4963325ffda6 Mon Sep 17 00:00:00 2001 From: Liz Mitchell Date: Tue, 18 Feb 2020 11:37:46 -0800 Subject: [PATCH 3/9] feat(typography): add CSS custom properties PiperOrigin-RevId: 295784229 --- packages/mdc-theme/_functions.scss | 15 +++- packages/mdc-typography/README.md | 95 ++++++++++++++++++++----- packages/mdc-typography/_mixins.scss | 76 +++++++++++++------- packages/mdc-typography/_variables.scss | 4 +- packages/mdc-typography/package.json | 3 +- 5 files changed, 145 insertions(+), 48 deletions(-) diff --git a/packages/mdc-theme/_functions.scss b/packages/mdc-theme/_functions.scss index 39d517871db..7fc74c1a0de 100644 --- a/packages/mdc-theme/_functions.scss +++ b/packages/mdc-theme/_functions.scss @@ -76,14 +76,23 @@ } @function get-var-fallback_($style) { - @return map.get($style, "fallback"); + $fallback: map.get($style, "fallback"); + @if is-var-with-fallback_($fallback) { + @return get-var-fallback_($fallback); + } @else { + @return $fallback; + } } @function var_($style) { $var: map.get($style, "varname"); - $fallback: get-var-fallback_($style); + $fallback: map.get($style, "fallback"); - @return var(#{$var}, $fallback); + @if is-var-with-fallback_($fallback) { + @return var(#{$var}, var_($fallback)); + } @else { + @return var(#{$var}, $fallback); + } } /// diff --git a/packages/mdc-typography/README.md b/packages/mdc-typography/README.md index 70c607efbba..0a68a8042af 100644 --- a/packages/mdc-typography/README.md +++ b/packages/mdc-typography/README.md @@ -67,6 +67,26 @@ We recommend using Roboto from Google Fonts: ## Style Customization +### Typography styles + +The typography styles (referred to as `