Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Adding support for predefined colour schemes #723

Closed
wants to merge 2 commits into from
Closed

Adding support for predefined colour schemes #723

wants to merge 2 commits into from

Conversation

syntaxerror
Copy link
Contributor

@syntaxerror syntaxerror commented Oct 4, 2017

This minor change will prevent a colorscheme setting to be written to customizer.css

Some more info about the thoughts behind this in the forum:
https://arastta.org/forum/customizer-predefined-color-schemes
https://arastta.org/forum/customizer-select-option-colour-scheme

To test, use t.ex. this in customizer.json:

    "colors": {
        "title": "text_colors_title",
        "description": "text_colors_description",
        "control": {
            "container_background-color": {
                    "type": "color",
                    "label": "text_colors_container_background_label",
                    "default": "#bdc3c7",
                    "selector": "body"
            },
            "container-color_color": {
                    "type": "color",
                    "label": "text_colors_container_color_label",
                    "default": "#666666",
                    "selector": "body"
            },
            "colorscheme": {
                "type": "select",
                "label": "text_colors_colorscheme_label",
                "default": "blue",
                "choices": {
                    "blue": "Blue",
                    "green": "Green",
                    "purple": "Purple",
                    "red": "Red"
                },
                "selector": "colors"
            }
        }
    }

This minor change will prevent a colorscheme setting to be written to customizer.css

To test, use t.ex. this in customizer.json:
    "colors": {
        "title": "text_colors_title",
        "description": "text_colors_description",
        "control": {
            "container_background-color": {
                    "type": "color",
                    "label": "text_colors_container_background_label",
                    "default": "#bdc3c7",
                    "selector": "body"
            },
            "container-color_color": {
                    "type": "color",
                    "label": "text_colors_container_color_label",
                    "default": "#666666",
                    "selector": "body"
            },
            "colorscheme": {
                "type": "select",
                "label": "Colour scheme",
                "default": "blue",
                "choices": {
                    "blue": "Blue",
                    "green": "Green",
                    "purple": "Purple",
                    "red": "Red"
                },
                "selector": "colors"
            }
        }
    }
@syntaxerror
Copy link
Contributor Author

Will rethink this, trying to make it more robust for adding more settings into the Customizer ref #721

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

Successfully merging this pull request may close these issues.

None yet

1 participant