I have a question I would like to ask to the WordPress developers, Usually when creating a shortcode that need to generate custom css how do you proceed?
For example a simple button shortcode with the following options :
- text color
- background color
- hover text color
- hover background color
The problem is the hover color option, I would like to generate it dynamically directly to a css file without having to put any custom css in the head or inline
block in the page.
The shortcode need of course to work when used several time in the same page.
I am thinking about using wp_add_inline_style or wp_filesystem.
The main goal of this question is to create a shortcode with custom css added in a dynamic css file or a way to not add custom css directly in the page but to stil be able to add hover attribute.
Any advice would be awesome.