Skip to content

Commit

Permalink
[AAE-12668] refactored typography for themes (#8268)
Browse files Browse the repository at this point in the history
* AAE-12668 refactored typography for themes

* AAE-12668 added missing spaces

* AAE-12668 removed parenthesis causing lint error
  • Loading branch information
tomaszhanaj authored Feb 16, 2023
1 parent 41f135d commit f18fd94
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 38 deletions.
14 changes: 9 additions & 5 deletions demo-shell/src/custom-style-dev.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '@angular/material' as mat;
@import '../../lib/core/src/lib/styles/index';
@include mat.core($alfresco-typography);
@import '../../lib/core/src/lib/styles/typography';
@include mat.core;

$primary: mat.define-palette($alfresco-accent-orange);
$accent: mat.define-palette($alfresco-accent-purple);
Expand All @@ -10,21 +11,24 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

@include mat.all-component-themes($theme);
@include alfresco-material-theme($theme);

$typography: map-get($theme, typography);

body,
html {
margin: 0;
height: 100%;
overflow: hidden;
font-size: mat.font-size($alfresco-typography, body-1);
font-family: mat.font-family($alfresco-typography);
line-height: mat.line-height($alfresco-typography, body-1);
font-size: mat.font-size($typography, body-1);
font-family: mat.font-family($typography);
line-height: mat.line-height($typography, body-1);
}

body {
Expand Down
32 changes: 17 additions & 15 deletions lib/core/src/lib/styles/_index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
/* stylelint-disable scss/no-global-function-names */
/* stylelint-disable scss/at-import-partial-extension */
@import './default-class';
@import './theming';
@import '../styles/colors';
@import '../styles/mixins';
@import '../form/components/widgets/form.theme';
@import '../clipboard/clipboard.theme';
@import './snackbar.theme';
Expand All @@ -21,6 +22,7 @@
$warn: map-get($theme, warn);
$accent: map-get($theme, accent);
$primary: map-get($theme, primary);
$typography: map-get($theme, typography);

// map SCSS variables to expose as CSS variables
$defaults: (
Expand Down Expand Up @@ -81,20 +83,20 @@
--theme-unselected-chip-bg-color: mat.get-color-from-palette($background, unselected-chip),
--theme-status-bar-bg-color: mat.get-color-from-palette($background, status-bar),
// fonts
--theme-font-family: mat.font-family($alfresco-typography),
--theme-body-1-font-size: mat.font-size($alfresco-typography, body-1),
--theme-body-2-font-size: mat.font-size($alfresco-typography, body-2),
--theme-body-1-line-height: mat.line-height($alfresco-typography, body-1),
--theme-display-1-font-size: mat.font-size($alfresco-typography, display-1),
--theme-display-3-font-size: mat.font-size($alfresco-typography, display-3),
--theme-display-4-font-size: mat.font-size($alfresco-typography, display-4),
--theme-caption-font-size: mat.font-size($alfresco-typography, caption),
--theme-title-font-size: mat.font-size($alfresco-typography, title),
--theme-subheading-1-font-size: mat.font-size($alfresco-typography, subheading-1),
--theme-subheading-2-font-size: mat.font-size($alfresco-typography, subheading-2),
--theme-button-font-size: mat.font-size($alfresco-typography, button),
--theme-headline-font-size: mat.font-size($alfresco-typography, headline),
--theme-headline-line-height: mat.line-height($alfresco-typography, headline),
--theme-font-family: mat.font-family($typography),
--theme-body-1-font-size: mat.font-size($typography, body-1),
--theme-body-2-font-size: mat.font-size($typography, body-2),
--theme-body-1-line-height: mat.line-height($typography, body-1),
--theme-display-1-font-size: mat.font-size($typography, display-1),
--theme-display-3-font-size: mat.font-size($typography, display-3),
--theme-display-4-font-size: mat.font-size($typography, display-4),
--theme-caption-font-size: mat.font-size($typography, caption),
--theme-title-font-size: mat.font-size($typography, title),
--theme-subheading-1-font-size: mat.font-size($typography, subheading-1),
--theme-subheading-2-font-size: mat.font-size($typography, subheading-2),
--theme-button-font-size: mat.font-size($typography, button),
--theme-headline-font-size: mat.font-size($typography, headline),
--theme-headline-line-height: mat.line-height($typography, headline),

--theme-adf-icon-1-font-size: map-get($custom-css-variables, 'theme-adf-icon-1-font-size'),
--theme-adf-picture-1-font-size: map-get($custom-css-variables, 'theme-adf-picture-1-font-size'),
Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-blue-orange.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette($alfresco-ecm-blue);
$accent: mat.define-palette($alfresco-accent-orange);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-blue-purple.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette(mat.$pink-palette, 700, 500, 900);
$accent: mat.define-palette($alfresco-accent-purple);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-cyan-orange.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette($alfresco-ecm-cyan);
$accent: mat.define-palette($alfresco-accent-orange);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-cyan-purple.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette($alfresco-ecm-cyan);
$accent: mat.define-palette($alfresco-accent-purple);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-green-orange.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette($alfresco-bpm-green);
$accent: mat.define-palette($alfresco-accent-orange);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-green-purple.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette($alfresco-bpm-green);
$accent: mat.define-palette($alfresco-accent-purple);
Expand All @@ -11,7 +11,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-indigo-pink.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette(mat.$indigo-palette);
$accent: mat.define-palette(mat.$pink-palette, A200, A100, A400);
Expand All @@ -12,7 +12,8 @@ $theme: mat.define-light-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-pink-bluegrey.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette(mat.$pink-palette, 700, 500, 900);
$accent: mat.define-palette(mat.$blue-grey-palette, A200, A100, A400);
Expand All @@ -12,7 +12,8 @@ $theme: mat.define-dark-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down
5 changes: 3 additions & 2 deletions lib/core/src/lib/styles/prebuilt/adf-purple-green.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@use '@angular/material' as mat;
@import '../theming';
@import './all-theme';
@include mat.core($alfresco-typography);
@include mat.core;

$primary: mat.define-palette(mat.$purple-palette, 700, 500, 800);
$accent: mat.define-palette(mat.$green-palette, A200, A100, A400);
Expand All @@ -12,7 +12,8 @@ $theme: mat.define-dark-theme(
color: (
primary: $primary,
accent: $accent,
)
),
typography: $alfresco-typography
)
);

Expand Down

0 comments on commit f18fd94

Please sign in to comment.