Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typography field outputs text align even if is not used #850

Closed
rahulv3a opened this issue Apr 8, 2016 · 2 comments
Closed

Typography field outputs text align even if is not used #850

rahulv3a opened this issue Apr 8, 2016 · 2 comments

Comments

@rahulv3a
Copy link

rahulv3a commented Apr 8, 2016

Issue description:

Once settings are saved, typography field outputs text-align: inherit in CSS even if text-align is not used in its defaults. This overrides text-align defined theme's CSS for the same element.

If .test a is targeted in CSS using the typography field in the code below. <a> is aligned to the left instead of center. This happens due to text-align: inherit in Kirki's CSS output.

<div class="test">
  <a href="#">This is a link</a>
</div>
.test a {
  display: block;
  text-align: center;
}

Version used:

v2.2.7

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

Kirki::add_config( 'my_config', array(
  'capability'  => 'edit_theme_options',
  'option_type' => 'theme_mod',
) );
Kirki::add_field( 'my_config', array(
  'settings' => 'my_typography',
  'section'  => 'my_section',
  'label'    => esc_html__( 'Typography', 'example' ),
  'type'     => 'typography',
  'default'  => array(
    'font-family'    => 'Open Sans',
    'variant'        => 'regular',
    'subset'         => array( 'latin-ext' ),
    'font-size'      => '11px',
    'letter-spacing' => '0',
    'text-transform' => 'uppercase',
  ),
  'output'   => array(
    array(
      'element'  => '.test a',
    ),
  ),
) );
<div class="test">
  <a href="#">This is a link</a>
</div>
.test a {
  display: block;
  text-align: center;
}
@hellor0bot
Copy link

I experience the same with font-weight.

@aristath
Copy link
Contributor

aristath commented Apr 9, 2016

Fixed.
The changes will apply once the value of the control changes and it's saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants