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

Change primary color attribute in theme #988

Closed
rajesh-s opened this issue Mar 23, 2019 · 3 comments
Closed

Change primary color attribute in theme #988

rajesh-s opened this issue Mar 23, 2019 · 3 comments

Comments

@rajesh-s
Copy link

rajesh-s commented Mar 23, 2019

Thanks for all your efforts on the development of this theme.

I am using the latest version of the them. In the theme settings default.toml (copied to create a custom theme), I updated the "primary" attribute, and see this update the "network-icon" field on the page for both light/dark accordingly. However, I do not see "primary_light" and "primary_dark" not affect the appearance of the elements.

In academic.css I do not see any color attribute i.e primary associated with the network icon field, is there a way I can change this to toggle based on dark/light?

@gcushen
Copy link
Collaborator

gcushen commented Mar 23, 2019

You can create a CSS plugin with your custom CSS:
https://sourcethemes.com/academic/docs/customization/#customize-style-css

It can be used to override Academic's styles. For light theme style, define .<SELECTOR-NAME> {...}. For dark theme style, define .dark .<SELECTOR-NAME> {...}.

@gcushen gcushen closed this as completed Mar 23, 2019
@rajesh-s
Copy link
Author

rajesh-s commented Mar 24, 2019

Thanks for the quick response
What is the value of .<SELECTOR-NAME> for network-icon?

I have the following in my custom.css but it does not override. I experimented within academic.css and the same definitions work there:

.dark a,
h3.article-title a:hover {
  color: {{ .Get "primary_dark" }};
}

.dark .form-control:focus {
  border-color: {{ .Get "primary_dark" }};
}

.dark .featurette-icon {
  color: {{ .Get "primary_dark" }};
}

@saadjavaid
Copy link

As a quick update, @rajesh-s I was able to get the featurette icon color changed in the dark mode by using the code code you provided. I placed the css file in assets/css and changed the param.toml plugin_css to the name of the css file.

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

3 participants