Skip to content

Commit

Permalink
resolves #307
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesros161 committed Jul 23, 2021
1 parent 338a84f commit b5517e0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/assets/js/customizer/typography/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ export class Preview {
let base = api( 'bgtfw_headings_font_size' )();
let unit = 'px';

// Handle variant of font sizes.
let variant = to.variant;
let fontWeight = parseInt( variant );
let fontStyle = variant.replace( fontWeight, '' );

// Build CSS.
let css = '';

Expand All @@ -51,6 +56,16 @@ export class Preview {
if ( 'floor' === selector.round ) {
val = Math.floor( val );
}

// Adds css for font variants.
if ( fontWeight && fontStyle ) {
css += rule + '{font-size:' + val + unit + ';';
css += 'font-style:' + fontStyle + ';';
css += 'font-weight:' + fontWeight + ';}';
} else if ( fontWeight ) {
css += rule + '{font-size:' + val + unit + ';';
css += 'font-weight:' + fontWeight + ';}';
}
css += rule + '{font-size:' + val + unit + ';}';
}
} );
Expand Down Expand Up @@ -102,6 +117,7 @@ export class Preview {
'bgtfw_site_title_typography',
'bgtfw_menu_typography_main'
];

this.addStyle( this.getCSS( api( 'bgtfw_headings_typography' )() ) );

typographyControls.forEach( control => this.addTypographyOverride( control ) );
Expand Down
1 change: 0 additions & 1 deletion src/assets/scss/boldgrid/_elements.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ body.custom-background {
/** Headings **/
.palette-primary {
@include headings() {
font-style: normal;
word-wrap: break-word;
hyphens: auto;
}
Expand Down

0 comments on commit b5517e0

Please sign in to comment.