Comments (36)
Oh but I should call that function right
from tauri.
Anyway we do need to bump boscop to 0.6.0, and put a color
config under tauri.conf.json > tauri > window.
from tauri.
There was a color setting in the earlier webview, it was able to only set the color of the background main window (the webview itself is transparent). Maybe it wouldn't be hard to bring it back to the current webview (but please, no transparent windows - they are not supported on all platforms very well and make things really confusing).
The primary use case for that originally was to initialize window with some color before webview content loads up (so that for dark content there was no white flickering). And the reason why it has been removed from the new webview is becuase on Windows for example that didn't help much.
In my mind, the content you are running inside the webview is responsible for the background color and the rest of the "look-and-feel" of the webview, which is transparent by default on most platforms I guess.
from tauri.
@Laegel - this seems like something that we should address in the docs for now - that device themes can mess up if you don't explicitly declare a background color.
I guess here: https://tauri.studio/docs/usage/identity
Then when we finally move to the official webview via our bindings, color is supported there and we've added the flag to the config we can add that to our documentation as well.
from tauri.
What OS are you using? I'm sure that happens if you're using some kind of GTK theme, don't know if that's the case for you.
from tauri.
And what happens if you set a non transparent background color in your CSS, like for example white?
from tauri.
The original (I have the arc gtk theme, that's why it's kind of messed up):
With body{background:blue}
CSS
from tauri.
Is there a way to override it? I don't think we should set color based on gtk theme.
from tauri.
Well, we're using GTK's webview, so I think we can't do anything.
from tauri.
Could we inject a stylesheet that sets it to white? I feel like your app should look the same as in a browser.
from tauri.
I think each browser has their own base stylesheet, but they aren't perfectly consistent.
from tauri.
This may have been resolved with some of the recent patches. I've noticed that the old react apps had a sort of grey background. Seems that they now are showing a white one instead.
from tauri.
@nklayman - can you confirm that @tensor-programming is right about this?
from tauri.
I still have the off-colored background.
from tauri.
I think we should file an issue about this on Boscop/web-view, maybe there's a C API to disable the theme. You can see that it's a theming issue by starting the app with another theme:
$ GTK_THEME=Adwaita:dark ./src-tauri/target/debug/app
from tauri.
have you tried with the latest 0.6 version of boscop - was just released a few days ago.
from tauri.
from tauri.
Same results with boscop/web-view 0.6.0
from tauri.
but we should def release a new version with boscop 0.6
from tauri.
set_color() works as expected (it sets the background color of the web-view) but GTK still uses the theme colors e.g. the font color is still the same obviously. So it doesn't help us much.
from tauri.
you know, maybe this is known. i looked at the examples at boscop, and it seems that they all have a background color set. ;)
from tauri.
IMO the GTK theme is the user's choice and we should leave it as is, if the app doesn't look good with the installed theme, he needs to set it manually.
from tauri.
def something for the docs. filing an issue at tauri.studio
from tauri.
Could we apply a default background-color:white
to the body
tag?
from tauri.
That won't fix the problem because the font color would still be messed up, as I said.
from tauri.
Ohh, my bad, didn't see that. I didn't have any font color issues so I thought it was just the background color.
from tauri.
If you use another GTK theme, you'll see different behaviors.
from tauri.
@nothingismagick the Windows theme also impacts the webview.
from tauri.
🤦♂
from tauri.
I'm not sure if this is good or bad news lol but we really need to look for a "disable theme" option upstream, if that's possible.
from tauri.
I bet @zserge knows how we could go about doing blocking that kind of behavior.
from tauri.
Isn't there or wasn't there a "color" flag?
from tauri.
Shouldn't we force it to white (the background color you can expect when you start working on a HTML app) and let users modify it optionally? Or is it going to be an issue even if we've defined an initial background color?
from tauri.
For some reason this is no longer an issue with Vue cli.
from tauri.
So close the issue?
from tauri.
Yep, just confirmed that the background is white.
from tauri.
Related Issues (20)
- forward Result of inner call in Webview::navigate
- [bug] tauri::api::path::app_local_data_dir returning different paths in Microsoft Store packaged app HOT 3
- [bug] tauri cli doesn't work without node installed HOT 3
- [feat] disable asset compression by default and don't ship brotli HOT 2
- [feat] Builtin state mutablity support HOT 1
- [feat] scope for asset protocol `convertFileSrc()`
- [feat] add a macro to help using image as tray icon from rust api directly HOT 4
- [bug] Rust deserialization of raw ipc fails
- Make it easy to configure the app's homepage for Windows installers HOT 3
- [bug] nsis installer won't stop spawned sidecar when upgrading HOT 3
- [feat] Better errors when deserializing capabilities
- The `Identifier` Type is Ambiguous
- [feat] Front-end implementation to obtain default icon API. HOT 2
- [bug] assert_ipc_response (Rust tests for icp commands) are broken on 1.6.7 HOT 5
- [bug] Yarn Executable not found by BuildTask.kt on windows, when building Android with Yarn and Svelte HOT 1
- [feat] v2: Frameworks aren't being picked up for iOS builds HOT 3
- [bug] [v2] drag and drop unable to locate in MacOS
- [bug] Audio autoplay not working on Windows
- [feat] add visionOS support HOT 7
- [bug] cargo tauri ios build with -c configuration override fails to build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tauri.