pixelgrade / customify

Intuitive Website Styling integrated into WordPress' Customizer
GNU General Public License v2.0
28 stars 5 forks source link

Add Extended Typography Fields #39

Closed georgeolaru closed 7 years ago

georgeolaru commented 8 years ago

It would be nice if we can bring together in one "extended" field the following typography related options:

font-family / font-weight / font-subset font-size / line-height letter-spacing / text-transform

This way we can reuse them more consistently.

I created an example and how this field configuration might look like:

// Example of an Extended Typography field
'extended_typography_example' => array(
    'type'        => 'font',
    'label'       => esc_html__( 'Item Title Font', 'noah' ),
    'desc'        => esc_html__( '', 'noah' ),
    'selector'    => '.c-card h2',

    // Set the defaults
    'default'   => array(
        'font-family' => 'Arca Majora',
        'font-weight' => '700',
        'font-subset' => 'latin-ext,cyrillic',
        'font-size'   => 24,
        'line-height' => 1.5,
        'letter-spacing' => 1,
        'text-transform' => 'none'
    ),

    // Sub Fields Configuration (optional)
    'fields'    => array(
        'font-family'   => array(
            'recommended' => $recommended_headings_fonts,   // List of recommended fonts defined by theme 
        ),
        'font-weight'   => array(
            'load_all_weights' => true,                     // False by default (used for Body fonts)
        ),
        'font-size'     => array(                           // Set custom values for a range slider
            'min'          => 8,
            'max'          => 20,
            'step'         => 1,
            'unit'         => 'px',
        ),
        'line-height'    => array(0, 2, 0.1, ''),           // Short-hand version
        'letter-spacing' => array(-5, 20, 1, 'em'),
        'text-transform'     => false                           // Disable sub-field (False by default) 
    )
),
andreilupu commented 8 years ago

Just a hint: aici propun ca type sa fie font @georgeolaru

georgeolaru commented 8 years ago

Se poate — eu m-am gandit doar ca deja avem field-ul de "typography" care ar fi putut fi "font-family" ca sa aiba sens sa folosim acum "font".

andreilupu commented 8 years ago

Eu asta cred, ca typography ar trebui sa ramana ca legacy o perioada iar noul font sa reprezinte type-ul cu subfields ca font-family, font-weight sau font-size aproape ca in CSS

georgeolaru commented 8 years ago

In regula atunci, ramane font. ( sa nu uiti si de line-height, letter-spacing si text-transform)

andreilupu commented 7 years ago

Done!

Cu mentiunea ca din config-ul initial am ajuns la cateva compromisuri precum: