Git Product home page Git Product logo

Comments (4)

dthenley avatar dthenley commented on June 2, 2024

Change out the variable names to have --wp--preset--<PRESET_TYPE>--<PRESET_SLUG>

Create elements that override core colors by

:root {
    --wp--preset--color--cyan-bluish-gray: <new_value>;
    --wp--preset--color--pale-pink: <new_value>;
}

change out colors in the inc/Editor/Component.php to have plain names with theme- prefixed except for where custom theme colors are in place

from wprig.

robruiz avatar robruiz commented on June 2, 2024

Couldn't all of this just be managed by adding a theme.json to the theme? Or do you have something else in mind here?

from wprig.

dthenley avatar dthenley commented on June 2, 2024

@robruiz this definitely can be managed by adding a theme.json file to the theme. I think part of the reason i put this in there was to make sure it got on the to do list.

Steps to take:

  1. Add theme.json file to theme
  2. Add theme.json to watch file for browsersync
  3. Remove the custom colors from the /inc/editor/component.php file.
    add_theme_support(
    'editor-color-palette',
    array(
    array(
    'name' => __( 'Primary', 'wp-rig' ),
    'slug' => 'theme-primary',
    'color' => '#e36d60',
    ),
    array(
    'name' => __( 'Secondary', 'wp-rig' ),
    'slug' => 'theme-secondary',
    'color' => '#41848f',
    ),
    array(
    'name' => __( 'Red', 'wp-rig' ),
    'slug' => 'theme-red',
    'color' => '#C0392B',
    ),
    array(
    'name' => __( 'Green', 'wp-rig' ),
    'slug' => 'theme-green',
    'color' => '#27AE60',
    ),
    array(
    'name' => __( 'Blue', 'wp-rig' ),
    'slug' => 'theme-blue',
    'color' => '#2980B9',
    ),
    array(
    'name' => __( 'Yellow', 'wp-rig' ),
    'slug' => 'theme-yellow',
    'color' => '#F1C40F',
    ),
    array(
    'name' => __( 'Black', 'wp-rig' ),
    'slug' => 'theme-black',
    'color' => '#1C2833',
    ),
    array(
    'name' => __( 'Grey', 'wp-rig' ),
    'slug' => 'theme-grey',
    'color' => '#95A5A6',
    ),
    array(
    'name' => __( 'White', 'wp-rig' ),
    'slug' => 'theme-white',
    'color' => '#ECF0F1',
    ),
    array(
    'name' => __( 'Dusty daylight', 'wp-rig' ),
    'slug' => 'custom-daylight',
    'color' => '#97c0b7',
    ),
    array(
    'name' => __( 'Dusty sun', 'wp-rig' ),
    'slug' => 'custom-sun',
    'color' => '#eee9d1',
    ),
    )
    );
  4. While we're at it we should remove custom font size from the same file and add it to the theme.json file.
  5. Remove the css support for the custom colors
    /* Custom editor colors */
    --color-theme-primary: #e36d60;
    --color-theme-secondary: #41848f;
    --color-theme-red: #c0392b;
    --color-theme-green: #27ae60;
    --color-theme-blue: #2980b9;
    --color-theme-yellow: #f1c40f;
    --color-theme-black: #1c2833;
    --color-theme-grey: #95a5a6;
    --color-theme-white: #ecf0f1;
    --color-custom-daylight: #97c0b7;
    --color-custom-sun: #eee9d1;
  6. Remove the css support for the custom fonts
    /* Custom editor font sizes */
    --font-size-small: calc(16 / var(--global-font-size) * 1rem);
    --font-size-regular: calc(var(--global-font-size) / 16 * 1rem);
    --font-size-large: calc(36 / var(--global-font-size) * 1rem);
    --font-size-larger: calc(48 / var(--global-font-size) * 1rem);
  7. Change out the css file to incorporate new variable names.

Side note we can probably get rid of almost all of the custom properties css file and plug those into the theme.json file. The only thing I have found that is definitely needed to stay has been the --content-width variable. This change will most likely end up breaking existing themes that does use the custom variables though.

from wprig.

dthenley avatar dthenley commented on June 2, 2024

As I'm going down the list this pretty much addresses making wp-rig into a universal theme #777 . I guess if we're not looking into doing that this is probably inconsequential but at least this can lend itself to a guide.

from wprig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.