-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: add isDarkTheme functions and composables #5698
Conversation
So you might want this a review ;) |
6f61196
to
6c96e2a
Compare
4752d56
to
208a1cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compared with Talk, works in Styleguids =)
208a1cc
to
6b08a99
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only two comments on the documentation
6b08a99
to
f8510ce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not import with ts
extension in Typescript files, while this works with bundlers, it does not for Typescript itself.
@@ -3,6 +3,7 @@ | |||
"include": ["./src/**/*.ts"], | |||
"exclude": ["./src/**/*.cy.ts"], | |||
"compilerOptions": { | |||
"allowImportingTsExtensions": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not work, just do not import with .ts
extension in Typescript files (in JS files it work).
"allowImportingTsExtensions": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, I missed that styleguidist uses a different config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 46 places with .ts
imports in this repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 46 places with .ts imports in this repo
This works as long as it is in JavaScript files and not Typescript.
Importing with .ts
extension in Typescript is invalid when emitting is enabled, as the output will be invalid.
So as long as we use a bundler everything works, but e.g. tsc
would not work, because Typescript does not rewrite import extensions, so you either have to import Typescript files with .js
or without any extension.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing with
.ts
extension in Typescript is invalid when emitting is enabled, as the output will be invalid.
So as long as we use a bundler everything works, but e.g.tsc
would not work, because Typescript does not rewrite import extensions, so you either have to import Typescript files with.js
or without any extension.
We almost never use tsc
as a compiler (except notify_push
) and in general, in modern TypeScript usage it's rarely used as a compiler/language and not as a static analyzer (type checker).
Specifically, in this repo, we already had @babel/typescript-preset
to work with TS as a static analyzer, and only the webpack config was not correct.
Fixed TS config for styleguidist (see the last commit) |
Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Grigorii K. Shartsev <[email protected]>
Signed-off-by: Grigorii K. Shartsev <[email protected]>
f8510ce
to
5eba1f1
Compare
Force-pushed docs fixes according to @susnux suggestions |
backport? |
/backport to next |
☑️ Resolves
A copy from what we use in Talk
window.matchMedia.('(prefers-color-scheme: dark)')
. It checks for the user's system theme, but Nextcloud Dark theme could be enabled even on the light system theme.[data-themes*=dark]
or[data-theme-dark]
attributes on the body. It checks for explicitly set dark theme, but a user may use the system theme.--background-invert-if-dark
🖼️ Screenshots
🏁 Checklist
next
requested with a Vue 3 upgrade