• Resolved noahj-champion

    (@noahj-champion)


    Hi.

    Is it possible for the css variables to work with capital letters and/or dashes?

    I’m not sure if this is a php thing of the var, your plugin or the framework I am working with, but I figured I would ask here first as a starting point.

    I have a nice work flow for my option values, but that includes capital letter and dashes. Those 2 things don’t work with the css variables.

    My theme options may look something like…

    // heading-variable-font_value
    // heading-variable-color_value
    // heading-variable-unit_amount_value
    // heading-variable-unit_type_value
    // heading-variable-line_height_value
    // heading-variable-text_rendering_value

    This allows my workflow to be faster because I can easily double click to copy and paste any text between a dash, like the “variable” above for example. And any text with underscores I can double click to copy as well. So in this case above I can easily just replace the variable for each similar option like…

    // heading-1-font_value
    // heading-1-color_value
    // heading-1-unit_amount_value
    // heading-1-unit_type_value
    // heading-1-line_height_value
    // heading-1-text_rendering_value
    // heading-2-font_value
    // heading-2-color_value
    // heading-2-unit_amount_value
    // heading-2-unit_type_value
    // heading-2-line_height_value
    // heading-2-text_rendering_value

    And so on…

    I’ve seen this done as maybe a rule of thumb or best practice when looking at other author’s plugins, but I couldn’t find anywhere online to backup that theory. So still being new to php, I’m not sure the rule, restriction or expectation here.

    Can this be done?

    https://www.ads-software.com/plugins/wp-dynamic-css/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Possible for css variables to work with capital letters and/or dashes?’ is closed to new replies.