-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use expressions in attribute values #35
Comments
@cossssmin I have two opinions on this:
I would prefer to move the logic into the method. the logic can be more complex and it will not be readable in templates locals: {
isProduction: (env) => env === 'production' ? 'active' : 'hidden'
} <p class="{{ isProduction(env) }}">in production!</p> |
Of course, my examples were very basic, users would be free to choose how they handle it. I came to think of this since there's no easy way to programatically extend a layout file - right now you have to write the Should I get started on a PR to show how I imagine this working? |
I think this will be a good start. |
@Scrum what do you think about adding support for
posthtml-expressions
inside attribute values?So we could then do:
... or:
I know you can just use
posthtml-expressions
in theplugins: []
option, but this can result in multiple expression evaluations if your build chain usesposthtml-expressions
later on (example).The text was updated successfully, but these errors were encountered: