Coverage for /Users/davegaeddert/Developer/dropseed/plain/plain-tailwind/plain/tailwind/templates.py: 100%
11 statements
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-23 11:16 -0600
« prev ^ index » next coverage.py v7.6.9, created at 2024-12-23 11:16 -0600
1from plain.assets.finders import APP_ASSETS_DIR
2from plain.runtime import settings
3from plain.templates import register_template_extension
4from plain.templates.jinja.extensions import InclusionTagExtension
7@register_template_extension
8class TailwindCSSExtension(InclusionTagExtension):
9 tags = {"tailwind_css"}
10 template_name = "tailwind/css.html"
12 def get_context(self, context, *args, **kwargs):
13 tailwind_css_path = str(settings.TAILWIND_DIST_PATH.relative_to(APP_ASSETS_DIR))
14 return {"tailwind_css_path": tailwind_css_path}