Skip to content

Add theme for argocd#245

Merged
crenshaw-dev merged 5 commits intoargoproj:masterfrom
saumeya:add-theme-for-argocd
Sep 7, 2022
Merged

Add theme for argocd#245
crenshaw-dev merged 5 commits intoargoproj:masterfrom
saumeya:add-theme-for-argocd

Conversation

@saumeya
Copy link
Contributor

@saumeya saumeya commented Jun 17, 2022

View steps to test in the upstream ticket
Upstream ticket - argoproj/argo-cd#9703

The main logic for creating the theme map is in this file - https://github.com/argoproj/argo-ui/pull/245/files#diff-9be47d1a6668e34bf14bd39d2c830ecd572725cac9912f2bcd5e9b6d512ec0f1

In this approach, it will be also easier to add more themes (light, dark, some other theme). Only theme.scss would need to be updated to add a new theme.

All the other places is just adding the @include themify directive.
Only the background colours are changed.
Some elements like drop downs and popups are not updated because of more complexity, can be updated after this is merged.

@saumeya saumeya force-pushed the add-theme-for-argocd branch from 6263f38 to d29b05f Compare June 17, 2022 10:56
@saumeya
Copy link
Contributor Author

saumeya commented Jun 17, 2022

Hi @rbreeze, Which all argo components use argo-ui and also I noticed some (dark) themes written in v2 components, could you please point towards how it works?

@saumeya saumeya requested a review from rbreeze June 17, 2022 11:25
@saumeya saumeya force-pushed the add-theme-for-argocd branch from d29b05f to e26a8f4 Compare June 26, 2022 20:13
saumeya added 4 commits June 27, 2022 01:53
Signed-off-by: saumeya <saumeyakatyal@gmail.com>
Signed-off-by: saumeya <saumeyakatyal@gmail.com>
Signed-off-by: saumeya <saumeyakatyal@gmail.com>
Signed-off-by: saumeya <saumeyakatyal@gmail.com>
@saumeya saumeya force-pushed the add-theme-for-argocd branch from d12374f to 5cf81aa Compare June 26, 2022 20:24
@saumeya saumeya marked this pull request as ready for review June 26, 2022 20:24
@rbreeze
Copy link
Member

rbreeze commented Aug 17, 2022

Hi @saumeya, thanks for doing this. To answer your question, the dark components you see are styled based on the theme context which can be accessed with the useTheme hook. Most of these components are wrapped in a ThemeDiv which will automatically apply --dark suffixes to all classes on the div, making it easy to add dark theme styles.

The theme setting is stored in localStorage; in the Argo Rollouts dashboard, this is toggled on and off with a button for example.

@saumeya
Copy link
Contributor Author

saumeya commented Sep 7, 2022

Thanks a lot for approving the PR @rbreeze, could you also merge it? Thanks for explaining the approach used in rollouts. I'll take a deeper look at it.

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

Successfully merging this pull request may close these issues.

3 participants