-
Notifications
You must be signed in to change notification settings - Fork 124
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
Allow custom colors for top nav bar #386
Comments
I feel that this one-off customisation should be done with custom styling in the site's own CSS file, rather than supported by MarkBind or MarkBind/vue-strap. There is little value that MarkBind can add, as compared to a request like #69 (Support custom boxes). |
Fair point. The counter-point is that every website would want to brand itself. Although it is once-per-website, it might be used by most markbind sites. If we leave it as DIY, we might still want to give guidance in documentation e.g., which class to override? Note that our target users are instructors. Until we have a WYSIWYG editor, we are forced to assume the target users have (or can learn) some basic programming skills but we cannot assume web programming expertise. It also depend on the cost of the feature too. For the time being, for my own sites, I'm OK as long as I'm told how to override the color :-) |
.navbar {
background-colour: green !important;
}
.navbar * {
color: black !important;
} |
Thanks @acjh Works after fixing typo |
Dropdown: .dropdown-item {
color: brown !important
}
Main text as in the website page content itself? |
Thanks @yamgent
No. I meant text in the main nav bar vs text in the dropdown items. Your solution is probably what I was looking for. Will try it out. |
If you don't want to affect other dropdowns: .navbar .dropdown-item {
color: brown !important
} |
I've tried using these on the website-base. While they work, it is quite a lot of css code to theme the whole navbar to a different color, including text and icons to match, not forgetting the hover over colors, boarders, shadows etc. I didn't manage to make it as good-looking as the default theme. I guess theming is harder than it appears at first :-p |
Indeed. But there is little value that MarkBind can add. MarkBind should go for pleasant styling, but theming does not need further support in the codebase. Theming can be a topic to be considered when doing #371 (Give examples for adding custom classes). |
I guess what I was wishing for here is to be able to specify a base color and the whole nav bar to change to match the color, i.e., almost like inbuilt themes for nav bar where I specify a color instead of a theme name. I guess that requires a lot of work behind the scene. |
If you mean like Bootstrap 4's We can create an example theming file though. |
I guess. More specifically, I wish I could specify just a base color (maroon?) and get a navbar like the one below. i.e., MarkBind figures out all the matching color variations for text, outlines, shadows, hover over etc.
I agree there is not much real value. But there is some perceived value because people don't want their site to look like everyone else's. In any case, this is not an urgent thing. At the moment we are not pushing to get more users. :-p |
White text is what |
Just noticed that Bootstrap already supports a bunch of color schemes for nav bars. Can be port that over to MarkBind? |
All 3 of those already work:
|
Like this |
How about we support more types? E.g.
|
Aren't users already able to add classes? |
That is true, users can just directly apply classes, there is no need to support additional attributes. |
So, like this? |
It doesn't work because While we already add author's custom classes at the end of the class list of the navbar, apparently the order in the class list doesn't even matter. It is only the order of the classes declared inside the css that matters. So going forward, are we sticking with fixing the |
I suggest we default We could expand the syntax to support common styles as done in MarkBind/vue-strap#26, but I believe it's counter-productive as navbar will probably be themed using classes, which we already support and should encourage authors to use. |
add-class overrides default class is a good policy to have in general, right? I think users will expect that from add-class, unless we say otherwise. |
Yes, but if the classes all resides in the same .css file, we do not have control over how the override happens. We could follow @acjh's suggestion on allowing a |
Sounds good. 👍 |
(Following up on our discussion in #745 to enable all navbar colors within any given theme) Can someone clarify my understanding that, for our navbar, Now that we support bootswatch themes, the classes are always combined like this to control how the theme colors show up (doesn't matter whether the text color is actually dark or light):
So I'm wondering if we can go with |
Note that |
Yep, the reason why I mention "doesn't matter whether the text color is actually dark or light" is because bootswatch themes take care of it. For example, in https://bootswatch.com/darkly/ the "light" navbar is still a dark one - you can see the code by hovering over a navbar and clicking on the |
I discussed offline with @yamgent about this. Basically the idea is to go ahead with an implementation that uses This allows 2 options for the user:
|
The navbar changes in #790 are blocking this, so I'll wait until that PR is merged before working on this. |
v1.1.10
Current: there are only two choices for top nav bar color: black and grey
Suggestion: Allow custom colors
Justification: To create a lightweight theme effect on sites. Especially useful when instructors work with several variations of the same site and want an easy way to distinguish between them.
The text was updated successfully, but these errors were encountered: