Skip to content

Commit f93388f

Browse files
authored
Add id to stylesheet element (#84)
Dynamically add id to the stylesheet element. This will add an id like `bulma-css` for default theme, and `bulma-css-<theme_name>` for any other theme.
1 parent 6b6bf12 commit f93388f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django_simple_bulma/templatetags/django_simple_bulma.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ def bulma(theme: str = "") -> SafeString:
2828

2929
# Build the html to include the stylesheet
3030
css = static(f"css/{theme + '_' if theme else ''}bulma.css")
31+
stylesheet_id = f"bulma-css-{theme}" if theme else "bulma-css"
32+
3133
html = [
3234
f'<link rel="preload" href="{css}" as="style">',
33-
f'<link rel="stylesheet" href="{css}">',
35+
f'<link rel="stylesheet" href="{css}" id="{stylesheet_id}">',
3436
]
3537

3638
# Build html to include all the js files required.

0 commit comments

Comments
 (0)