question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Are there any idea’s how we will support dark mode? I assume we’ll be using a CascadingParameter to choose the theme or do you have any other idea’s?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:24 (18 by maintainers)

github_iconTop GitHub Comments

5reactions
Honacommented, Nov 2, 2021

I am planning on implementing my ThemeProvider into AntBlazor natively soon

3reactions
Honacommented, Jan 21, 2021

@diegofrata Using modifyVars at runtime for every user is expensive, it takes about 4 seconds in my testing.

# Now compile Ant Design less into CSS with custom theme
FROM node as theme
WORKDIR /theme
COPY --from=build /src/publish/wwwroot/_content/AntDesign/less/ .
COPY ["config/customTheme.less", "customTheme.less"]
RUN npm install less -g
RUN npm install less-plugin-clean-css -g
RUN lessc --clean-css="--s1 --advanced --compatibility=ie8" --js customTheme.less customTheme.css

FROM nginx:alpine
WORKDIR /var/www/web
COPY --from=build /src/publish/wwwroot .
COPY --from=theme /theme/customTheme.css css/customTheme.css
COPY ["Frontend/SharksApp.Frontend.Web/nginx.conf", "/etc/nginx/nginx.conf"]
EXPOSE 80

For anyone trying to implement this themselves, I made custom themes in my docker file this way.

customTheme.css:

@import "ant-design-blazor.less";

// Override variables here
@primary-color: #1890ff; // primary color for all components
@link-color: #1890ff; // link color
@success-color: #52c41a; // success state color
@warning-color: #faad14; // warning state color
@error-color: #f5222d; // error state color
@font-size-base: 14px; // major text font size
@heading-color: rgba(0, 0, 0, 0.85); // heading text color
@text-color: rgba(0, 0, 0, 0.65); // major text color
@text-color-secondary: rgba(0, 0, 0, 0.45); // secondary text color
@disabled-color: rgba(0, 0, 0, 0.25); // disable state color
@border-radius-base: 2px; // major border radius
@border-color-base: #d9d9d9; // major border color
@box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 9px 28px 8px rgba(0, 0, 0, 0.05); // major shadow for layers
Read more comments on GitHub >

github_iconTop Results From Across the Web

Dark Mode
Dark Mode is an extension that helps you quickly turn the screen (browser) to dark at night time. Toolbar button serves as an...
Read more >
Browse in Dark mode or Dark theme - Android
Turn on Dark theme · On your Android device, open Google Chrome Chrome . · At the top right, tap More More and...
Read more >
Dark Reader
Install Dark Reader browser extension. Configure the dark theme: brightness, contrast and sepia. Enable for all websites or particular domains.
Read more >
Browse in Dark mode or Dark theme - Computer
When you browse in Dark mode or Dark theme in Chrome, your homepage, toolbar, settings, and some other pages will be dark. Computer...
Read more >
Use Dark Mode on your iPhone and iPad
Turn on Dark Mode in Settings or Control Center. Go to Settings, then tap Display & Brightness. Select Dark to turn on Dark...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found