fresh
fresh copied to clipboard
Auto appending a data attribute for search parameters
There is already a feature for automatically add a data attribute for matching urls and I think this is awesome feature. You can find the source code in the runtime/active_url.ts file.
And I suggest add something like this for search parameters:
tailwind:
data-[param-<name>-<exact|includes>=<value>]:<style>
css:
element[data-param-<name>-<exact|includes>=<value>] {
<style>
}
Example:
url: /search?q=shirt&size=xl
data-[param-size-exact=x] = false
data-[param-size-exact=xl] = true
data-[param-size-includes=x] = true