diff options
author | Wolfgang Müller | 2022-04-09 18:34:30 +0200 |
---|---|---|
committer | Wolfgang Müller | 2022-04-09 18:34:30 +0200 |
commit | 7be2d558d35cf02863a10427b0877bddae424e97 (patch) | |
tree | b4109648705341c720b2af0e4d5d23d7e5a728a2 /templates/shortcodes | |
parent | 31f7cf3bbe53cc285d7074562e1ee23c20519722 (diff) | |
download | zunzuncito-7be2d558d35cf02863a10427b0877bddae424e97.tar.gz |
Use float classes instead of inline styles
Commit ea7baaa (templates: Allow setting 'float' for figures in the
'img' shortcode, 2022-04-09) introduces inline styles which were
considered more straightforward than adding special CSS rules. Sadly,
restrictive Content-Security-Policy settings will make browsers
disregard inline styles as a security measure.
Since we don't want to turn off CSP, this comment implement CSS rules
for setting the float attribute on elements.
Diffstat (limited to 'templates/shortcodes')
-rw-r--r-- | templates/shortcodes/img.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index 320ac84..d57e54e 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -3,7 +3,7 @@ {% if not float -%} <figure> {% else -%} -<figure style="float: {{ float }};"> +<figure class="float-{{ float }}"> {% endif -%} <a href="{% if link %}{{ link }}{% else %}/{{ url }}{% endif %}"> <img src="{{ image.url }}" alt="{{ alt }}" /> |