htmx icon indicating copy to clipboard operation
htmx copied to clipboard

htmx-config with comma separated key=value pairs instead of JSON

Open zeroizerz opened this issue 3 years ago • 2 comments

The current htmx-config meta tag requires switching from double quotes to single quotes to accommodate a JSON object. It also mixes JavaScript notions with HTML. Using kebab-case with comma separated key=value pairs would be more consistent with how normal HTML attributes are declared. For example, just like the meta viewport tag: <meta name="viewport" content="width=device-width, initial-scale=1">

So this: <meta name="htmx-config" content='{"defaultSwapStyle":"outerHTML", "includeIndicatorStyles":false}'> Would become: <meta name="htmx-config" content="default-swap-style=outer-html, include-indicator-styles=false">

zeroizerz avatar May 15 '22 07:05 zeroizerz

I like this idea. It looks cleaner and is closer to plain HTML, which I think htmx should strive for.

rashadg1030 avatar May 26 '22 23:05 rashadg1030