@@ -39,13 +39,15 @@ import { ControlPane } from "./components/control-pane/index.js";
3939import { LayerBackground } from "./components/layer-background/index.js" ;
4040import { PaletteGradient } from "./components/palette-gradient/palette-gradient.js" ;
4141import { SampleApp } from "./sample/index.js" ;
42+ import { typeRampScale , Typography } from "./typography/index.js" ;
4243import { State } from "./state.js" ;
4344
4445ColorBlock ;
4546ControlPane ;
4647LayerBackground ;
4748PaletteGradient ;
4849SampleApp ;
50+ Typography ;
4951
5052const colorBlockTemplate = html < App > `
5153 ${ repeat (
@@ -85,6 +87,12 @@ const sampleTemplate = html<App>`
8587 </app-design-system-provider>
8688` ;
8789
90+ const typographyTemplate = html < App > `
91+ <app-design-system-provider>
92+ <app-typography></app-typography>
93+ </app-design-system-provider>
94+ ` ;
95+
8896const template = html < App > `
8997 <div class="container fill">
9098 <div class="row fill">
@@ -241,6 +249,18 @@ export class App extends FASTElement {
241249 case "wcagContrastLevel" :
242250 wcagContrastLevel . setValueFor ( app . canvas , source . wcagContrastLevel ) ;
243251 break ;
252+ case "typeScaleBaseSize" :
253+ typeRampScale . base . fontSize . setValueFor ( app . canvas , `${ source . typeScaleBaseSize } px` ) ;
254+ break ;
255+ case "typeScaleMultiplier" :
256+ typeRampScale . multiplier . setValueFor ( app . canvas , source . typeScaleMultiplier ) ;
257+ break ;
258+ case "typeScaleLineHeightRatio" :
259+ typeRampScale . lineHeightRatio . setValueFor ( app . canvas , source . typeScaleLineHeightRatio ) ;
260+ break ;
261+ case "typeScaleLineHeightSnap" :
262+ typeRampScale . lineHeightSnap . setValueFor ( app . canvas , `${ source . typeScaleLineHeightSnap } px` ) ;
263+ break ;
244264 default :
245265 break ;
246266 }
@@ -266,6 +286,8 @@ export class App extends FASTElement {
266286 public componentTypeTemplate ( ) : ViewTemplate < App , any > {
267287 if ( this . state . componentType === ComponentType . sample ) {
268288 return sampleTemplate ;
289+ } else if ( this . state . componentType === ComponentType . typography ) {
290+ return typographyTemplate ;
269291 } else {
270292 return colorBlockTemplate ;
271293 }
0 commit comments