NativeScript / theme

@nativescript/theme
https://v7.docs.nativescript.org/ui/theme
Apache License 2.0
128 stars 44 forks source link

How to set the background of ActionBar to real transparent #253

Closed rushairer closed 4 years ago

rushairer commented 4 years ago

Action Bar can not set background to real transparent.

000000 can not work in iOS.

ActionBar,
.nt-action-bar,
.ns-dark ActionBar,
.ns-dark .nt-action-bar {
    background-color: unset;
}

Will get an error:

Error: Failed to apply property [background-color] with value [unset] to ActionBar(77). Color(file:///node_modules/@nativescript/core/color/color-common.js:28:36)
bundyo commented 4 years ago

Does it work with transparent?

rushairer commented 4 years ago

transparent will get #000000, but in ios runtime, #000000 is not transparent, is black. I guess the class Color of NativeScript did not convert #000000 to UIColor.clear.

rushairer commented 4 years ago

Another issue is that, if we set NavBar 's background color to UIColor.clear, it will not real Blur effect.

We need set the backgroundColor = nil.

So, I think, we'd like convert unset of NativeScript side to nil of iOS side.

bundyo commented 4 years ago

Not really - transparent is rgba(0,0,0,0), not #000000, which is black. You might got that wrong from the #rrggbbaa notation, where #00000000 is transparent, but I think {N} currently doesn't support #rrggbbaa notation yet.

Additionally unset keyword is not yet supported in NativeScript too.

Overall this issue is not really for the Theme, but for {N} itself - you might want to open a new issue in the NativeScript repo, if it is not yet reported. I found one, that might be related: https://github.com/NativeScript/NativeScript/issues/4805

I'm closing this one.

rushairer commented 4 years ago

@bundyo thanks.