Skip to content

Suggestions for the namespace and css twig tags to make templating more component oriented. #9939

Answered by brandonkelly
mikesnoeren asked this question in Ideas
Discussion options

You must be logged in to vote
  1. withClasses as default.

{% namespace %} is generally used to namespace IDs and form input names. Prefixing class names by default would be a massive breaking change that would require most instances adding a withoutClasses, so not going to happen. Even if it were just configurable but disabled by default, that would still have other consequences, such as for plugins that provide example front-end template code.

  1. Make namespaces respect css tag

Agree we should probably apply withClasses to nested {% css %} tags. That would also be a breaking change (albeit less risky), so I’ll look into it for Craft 4.

  1. Add an option to the css tag to generate a css file

This wouldn’t work on loa…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by brandonkelly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants