Compare commits

...

2 Commits

Author SHA1 Message Date
Ray Elliott 146bb0e0fe do not exit after composer setup 2020-05-07 20:18:35 +00:00
Ray Elliott a833f5bf94 add typography mixins, google fonts helper 2020-05-07 20:13:07 +00:00
5 changed files with 69 additions and 13 deletions

5
SETUP
View File

@ -35,10 +35,7 @@ then
exit 10
fi
php composer-setup.php --quiet
RESULT=$?
rm composer-setup.php
exit $RESULT
php composer-setup.php
php composer.phar install

View File

@ -139,6 +139,24 @@ function _s_widgets_init() {
}
add_action( 'widgets_init', '_s_widgets_init' );
function google_fonts() {
$google_fonts = apply_filters(
'storefront_google_font_families', array(
// 'source-sans-pro' => 'Source+Sans+Pro:400,300,300italic,400italic,600,700,900',
'montserrat' => 'Montserrat:400,600',
)
);
$query_args = array(
'family' => implode( '|', $google_fonts ),
'subset' => rawurlencode( 'latin,latin-ext' ),
);
$fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' );
return $fonts_url;
}
/**
* Enqueue scripts and styles.
*/
@ -146,6 +164,8 @@ function _s_scripts() {
wp_enqueue_style( '_s-style', get_stylesheet_uri(), array(), _S_VERSION );
wp_style_add_data( '_s-style', 'rtl', 'replace' );
wp_enqueue_style( '_s-google-fonts', google_fonts(), array(), null );
wp_enqueue_script( '_s-navigation', get_template_directory_uri() . '/js/navigation.js', array(), _S_VERSION, true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {

View File

@ -1,11 +1,49 @@
@mixin font-1($weight) {
// see functions.php->google_fonts()
// and functions.php->_s_scripts()
font-family: "Montserrat", sans-serif;
@if $weight == regular {
font-weight: 400;
} @else if $weight == bold {
font-weight: 600;
} @else if $weight == extra-bold {
font-weight: 700;
} @else {
@error "font-weight #{$weight} not in valid font-weights for font-1: 'Montserrat'.";
}
}
@mixin font-body($weight: regular) {
@include font-1($weight);
}
@mixin font-title($weight: regular) {
@include font-1($weight);
}
@mixin font-link($weight: regular) {
@include font-1($weight);
}
@mixin font-code($weight: regular) {
font-family: $font-code;
font-weight: $weight;
}
@mixin font-pre($weight: regular) {
font-family: $font-pre;
font-weight: $weight;
}
// Center block
@mixin center-block {
display: block;
margin-left: auto;
margin-right: auto;
display: block;
margin-left: auto;
margin-right: auto;
}
// Column width with margin
@mixin column-width($numberColumns: 3) {
width: map-get($columns, $numberColumns) - ( ( $columns__margin * ( $numberColumns - 1 ) ) / $numberColumns );
width: map-get($columns, $numberColumns) -
(($columns__margin * ($numberColumns - 1)) / $numberColumns);
}

View File

@ -4,10 +4,10 @@ input,
select,
optgroup,
textarea {
color: $color__text-main;
font-family: $font__main;
font-size: 1rem;
line-height: $font__line-height-body;
color: $color__text-main;
@include font-body;
font-size: 1rem;
line-height: $font__line-height-body;
}
@import "headings";

View File

@ -1,5 +1,6 @@
// stylelint-disable value-keyword-case
$font__main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
$font__main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
// stylelint-enable value-keyword-case
$font__code: monaco, consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
$font__pre: "Courier 10 Pitch", courier, monospace;