Skip to content
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

css: Allow pass params to css function #486

Closed
dmitryuck opened this issue Feb 2, 2024 · 1 comment
Closed

css: Allow pass params to css function #486

dmitryuck opened this issue Feb 2, 2024 · 1 comment

Comments

@dmitryuck
Copy link

Allow css to receive params:

css red(myColor string) {
	background-color: myColor;
}

templ ex() {
  <div class={red("#ff0000")}></div>
}
@a-h
Copy link
Owner

a-h commented Feb 2, 2024

Hi @dmitryuck - that's a duplicate of #88.

It was closed (yesterday) in #484, so the next version of templ will have params - very similar to what you've asked for, except it would be:

css bgColor(color string) {
	background-color: { color };
}

You can try it out by using the main branch if you like.

@a-h a-h closed this as completed Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants