Simple user stylesheet support. (#258)

This commit is contained in:
Tyler Kennedy 2022-12-24 09:28:39 -05:00 committed by GitHub
parent cda7467802
commit 801c807a2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -246,3 +246,5 @@ class Config(models.Model):
# wellness Options
visible_reaction_counts: bool = True
custom_css: str | None

View file

@ -22,6 +22,9 @@
}
{% endif %}
</style>
{% if config_identity.custom_css %}
<style>{{ config_identity.custom_css }}</style>
{% endif %}
{% block extra_head %}{% endblock %}
</head>
<body class="{% block body_class %}{% endblock %}" hx-headers='{"X-CSRFToken": "{{ csrf_token }}"}'>

View file

@ -20,9 +20,15 @@ class InterfacePage(SettingsPage):
"title": "Show Boost and Like Counts",
"help_text": "Disable to hide the number of Likes and Boosts on a 'Post'",
},
"custom_css": {
"title": "Custom CSS",
"help_text": "Theme the website however you'd like, just for you. You should probably not use this unless you know what you're doing.",
"display": "textarea",
},
}
layout = {
"Posting": ["toot_mode", "default_post_visibility"],
"Wellness": ["visible_reaction_counts"],
"Appearance": ["custom_css"],
}