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

Add "prefix", "suffix" & "calc" arguments to the output array for fields #200

Closed
aristath opened this issue Apr 23, 2015 · 4 comments
Closed
Labels
Milestone

Comments

@aristath
Copy link
Contributor

This will allow more complex logic and handling most cases.

Prefix: for example to make the output part of a media query
Suffix: for !important etc
calc: so that the value can be calculated based on a user function before output

@aristath aristath added this to the 1.0 milestone Apr 23, 2015
@ghost
Copy link

ghost commented Apr 23, 2015

Pure awesome
thanks Aris

@aristath
Copy link
Contributor Author

Example:

        'output'      => array(
            'element'  => 'body #page',
            'property' => 'color',
            'prefix'   => '@media ( max-width: 1200px ) {',
            'suffix'   => '}',
            'callback' => 'kirki_twentytwelve_alter_color',
        )

and then a dummy callback function could look like this:

/**
 * Darkens the color a bit
 */
function kirki_twentytwelve_alter_color( $color ) {
    return Kirki_Color::adjust_brightness( $color, -50 );
}

@MikeiLL
Copy link

MikeiLL commented Jul 29, 2016

This looks promising! Going to try using for font-sizing in media queries.

@MikeiLL
Copy link

MikeiLL commented Jul 29, 2016

NOTE: See this post for updated approach.

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

No branches or pull requests

2 participants