django-semantic-admin icon indicating copy to clipboard operation
django-semantic-admin copied to clipboard

Customisation

Open eatyourpeas opened this issue 2 years ago • 6 comments

Hi lovely idea, thank you for putting it together.

How would one override some of the styles to allow some of the fomantic classes to be customised?

eatyourpeas avatar Sep 18 '22 08:09 eatyourpeas

There is an extrahead and extrascript block in base.html

What would you like to customize exactly?

globophobe avatar Sep 19 '22 09:09 globophobe

The lovely thing about semantic/fomantic is the option to override all the styles. You can either do this using the config or subclass the css directly. Your admin solution, for example, has an image that says 'Django Admin' and it would be nice for users to be able to replace that with their own logo, as well as change the styles such as font and colour. If you have any ideas how I could do that, or there was any way you wanted me to contribute to your repo to make that clearer I would be grateful and happy to help.

eatyourpeas avatar Sep 19 '22 09:09 eatyourpeas

The logo can be changed by overriding the branding block of menu.html

As for customizing fomantic, I suppose you mean to allow building a custom fomantic dist, and using that instead of the default?

Maybe there should be settings to change the logo, and fomantic stylesheet 🤔

globophobe avatar Sep 19 '22 10:09 globophobe

I think that would be really helpful. That way, users that are using semantic for their django front end can match their styling for the admin interface too. I think fomantic/semantic have a themes.config where you can set custom colours/styles. In my own project, I did not install all that, just override the individual css element in a file which I store in static. I am not sure how to go about helping, but I am really happy to try if you have any suggestions on where to start.

eatyourpeas avatar Sep 19 '22 17:09 eatyourpeas

In my own project, I did not install all that, just override the individual css element in a file which I store in static.

In the demo project settings I added to TEMPLATES https://github.com/globophobe/django-semantic-admin/blob/7c432b8022425b18316e6478e3f3f1f391e2e634/demo/demo/settings/base.py#L81

Create templates/admin/base_site.html You can extend extrahead

{% extends 'admin/base_site.html' %}
{% load static %}

{% block extrastyle %}
  <link rel="stylesheet" href="{% static "override.css" %}" />
{% endblock %}

globophobe avatar Sep 20 '22 13:09 globophobe

Added some docs https://globophobe.github.io/django-semantic-admin/customization/

globophobe avatar Sep 22 '22 03:09 globophobe