-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Implement and document styles customization #5
Comments
why can't there be just .css files inside the ./var directory, including the ones with the default themes? |
A simple solution could be to add en env var
Edit: the following does not work, as it messes a bit too much with authentication. For it to work, you should also proxy /auth/ and re-declare your main site to all the OAuth provided instead of the remark42 site. Not worth the trouble for just styling in my case. On my apache web server in the meantime I have made this code that works currently, with the hack that I have proxied the urls I added some code to the client-side javascript added to pages (after the line It is usable now but of course it is not a general solution as it supposes the urls /web/ and /api/ are free to use on the host server. The %-vars are variables provided by my host site, a Foswiki engine.
|
And.. I missed the obvious, simple solution: If you access your remark42 server via a proxy, just redirect in the proxy the urls:
With the proxy configured to redirect For my apache proxy, this means:
The css are thus excluded from the proxying (the |
Mmm, this is not sufficient. We should also be able to specify a different CSS for each SITE. Maybe with an additional variable SITES_CSS containing a comma-separated list of space-separated pairs of site and their css url? e.g.: |
@ColasNahaboo could you attach your overridden css. It is interesting, what is real user want to customize? Maybe we can provide more reliable and convenient api. And also what do you think about follow approach #599 (comment)? |
I am in the process of totally redesigning my web site, and remark42 will be used on the new version, so I am not fixed yet on what I wanted to customize, so for now I just wanted to see if it was possible. Here its current state, mainly to make the fonts consistent with the rest of the site:
|
On #599, I like the idea of specifying the customization with a field of Just let people provide their CSS, (that can be a provided "theme") with a option to either replace or add to the built-in CSS. remark42 is an ancillary technology that is to be used on web sites that already use some conventions or framework to manage colors and styles. In my opinion, just accepting standard CSS is the best way to ease integration, otherwise you run the risk of having people struggle to provide the info in some remark42 specific formalism instead of just plain CSS. |
Colors in custom properties is good solution for theming. But use styles from CSS from parent site is impossible for the remark42 customization because it is inside iframe. |
Yes, providing custom CSS sounds like the easiest way, both for you developers and for users who just want to customize the theme. To prevent users from using outdated CSS files in future versions, however, what I suggest is some sort of "put your additional CSS in this file and we will auto-import the rest" or some kind of versioning scheme (like in a subfolder, If we have to consider supporting different websites on the same instance too, as @ColasNahaboo, you could, again, add the domain to the css path:
or, by valuing version before domain:
Either way, there are plenty of viable and perfectly fine ways to implement this, so I really hope it won't be particularly difficult to do! And thanks for the awesome project you're bringing to all of us :) |
Hey! No update on this? |
@mind-overflow we are working on a few different features now, they are relative to this. We will try to add this feature as a beta in the near future. |
Oh, ok - that's great news! I was gonna fork the repo and try to implement this myself, but if you're already working on related features, I don't want to take the risk of making something that may or may not be compatible (or redundant) with those upcoming things. Thanks for the awesome work! |
@mind-overflow yep, sure. I'll write if smth changes. Thanks ;) |
While developing the new auth form I added permanent class names on that part of the interface and it could be customized. The next step is to provide the ability to connect third-party CSS file for styles customization. |
I just wrote up a short blog post on how to customize the css via the proxy workaround discussed here. It contains a solution for proxying with Nginx(vs Apache): https://maxmastalerz.com/blog/how-to-customize-remark42-css-via-a-proxy-workaround |
I am also currently having to resort to a reverse-proxy approach to delivering custom CSS. It would be fantastic if it was possible to inject some custom CSS overrides using a docker volume mount or something similar! Thanks for all your great work on remark42! The reverse-proxy approach is hard to make work nicely with a local development environment. |
We should have a way to define external CSS for basic customizations - things like link colors, font sizes, and other styles.
On compose level this will be as simple as some volume mapping, like
- ./etc/styles.css:/srv/web/styles.css
Also, need instructions in the readme on how to do it and what we allow to customize (with an example)
The text was updated successfully, but these errors were encountered: