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

Style dictionaries don't work #12

Open
adamlwgriffiths opened this issue Apr 5, 2021 · 0 comments
Open

Style dictionaries don't work #12

adamlwgriffiths opened this issue Apr 5, 2021 · 0 comments

Comments

@adamlwgriffiths
Copy link

Having dicts in dicts doesn't work.
This is helpful for styling elements inline.

In [1]: from cottonmouth.tags import *

In [2]: from cottonmouth.html import *

In [3]: render([input, {'style': {'visibility': 'hidden'}}])
Out[3]: '<input style="{\'visibility\': \'hidden\'}"></input>'

Expected output:

'<input style="visibility: hidden;"></input>'

My current suggestion would be to render a dict in a dict as a CSS string.
Off the top of my head, I'm not sure where else this may be helpful or if it may cause any conflicts.

adamlwgriffiths added a commit to adamlwgriffiths/cottonmouth that referenced this issue Apr 12, 2021
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

1 participant