-
Notifications
You must be signed in to change notification settings - Fork 311
Lot sass color variable make white screen on android #506
Comments
From @codeart1st on December 2, 2016 14:19 I can confirm this. That's the reason why we override the cleancss config to not override the original main.css file in build folder. |
From @EDumdum on December 2, 2016 14:45 Same problem. It would be nice to avoïd generating so many css class (color^2) for component like toolbar, as we usually use one color for the whole application. |
any workarounds for this? just blocked... |
package.json:
config/cleancss.config.js:
As for now you can disable the override from cleancss task. |
Hi @brandyscarney, any progress about this bug? |
Hey everyone, can I ask what you are using the colors for? Each color that is added will generate about 700 selectors. This means even adding 1 color will make your CSS file a lot larger. In general the |
In our case, our client give us a color palette about ~20 colors. And "each" components (that we use, because we don't use all components available in ionic) should be able to change it's color. |
Thanks @movrack! Does the user control what colors are shown or are you changing them at runtime? Could anyone send me a repository of a real world situation? |
I vote for dropping the SASS method of coloring components, and moving to a truly dynamic method (i.e. when a user can choose any arbitrary hex color rather than something from a preset list). I'm working on a sports related app where I need to theme different parts of the app based on a theoretically infinite amount of user-created teams, each with unknown-to-me colors. Some components like the navbar (which is the most important to me) are tricky to customize. I really want to be able to set any component's color like:
and...
|
In my app, there're 10+ levels, every level will change the theme. |
For now, use fewer colors in colors array. That is the best bet. There isn't a simple fix here. Thanks, |
Why is this closed? Suggesting to use fewer color can't be done for legacy apps. This should be reopened. |
i actually made my own colors
and using it like this
this works with |
https://github.com/DrMabuse23/ionic2-color-issue breaks android file plugin |
@movrack Where can I find more info about this Android WebView bug? |
Guys, this cleancss config can fix this issue: module.exports = {
/**
* sourceFileName: the file name of the src css file
*/
sourceFileName: process.env.IONIC_OUTPUT_CSS_FILE_NAME,
/**
* destFileName: the file name for the generated minified file
*/
destFileName: process.env.IONIC_OUTPUT_CSS_FILE_NAME,
options: {
advanced: false
}
}; |
I don't know if it's comming from android web view. I just see I can't set more than ~25 var in array else it make a too big css rendering. |
Reopening, we'll take another look at this. |
@brandyscarney, I'd like to explain why I need as many color variables as possible. My Ionic app has a "chameleon feature". What does it mean? Well, it gives the user the option to customize his/her store inside my app. He is able to choose a logo and a color for his store. Then the app applies the colors to ion-navbar like this: |
Same problem here, with around 40 colors in it. |
@rafaelgoulart How big is your main.css? It must be around 3-4MB? |
For my app, I'm looking at a baseline of at least 600 colors. But even if I could use that many, the UX calls for the user to create the colors on their own, so they can't be predefined in Sass anyway. |
Well the solution is simple the CSS files habe to be split ! |
It could be nice to have app-scripts log a performance warning when using something like 10+ colors. |
A possible solution to this is perhaps to have Old
New
This would require 20 new color variables, and a tiny refactoring of 60 files (20*3 platforms). |
Ouch. Can we maybe, instead of only defining global
|
@herman1vdb In the next major release (Ionic v4), apps will only load the colors they use for the components they use, so you will be able to define in your main colors many more colors, and they will be loaded strictly when they are needed for the components they are needed for (the ones you are actually using) |
@AmitMY That's great news! Do you know when the v4 should be expected? |
My apologies, I hear from the devs that it is only gonna get the scss for the components you use, and their platform, but colors are still (at this point) fully loaded. @antoine92190 Currently unknown. So hopefully soon, but unfortunately not very soon. |
That means i cant set colors dynamic by code ? only when i use it in my html ? |
@DrMabuse23 Currently it functions the same way as v3, so no custom colors. |
i removed all custom styling from my app for testing but still having whitescreen any help ? @brandyscarney |
From @movrack on December 2, 2016 13:45
Ionic version: (check one with "x")
[ ] 1.x
[x] 2.x
I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
When we use "to many" colors variables in theme/variables.scss color(), then we get a white screen at startup.
Expected behavior:
App start normally without white screen
Steps to reproduce:
Create a new App, for example :
ionic start checkColorBug sidemenu --v2
Modify color variable in app/theme/variables.css
$colors: ( primary: #387ef5, secondary: #32db64, danger: #f53d3d, light: #f4f4f4, dark: #222, dark1: #222, dark2: #222, dark3: #222, dark4: #222, dark5: #222, dark6: #222, dark7: #222, dark8: #222, dark9: #222, darka: #222, darkz: #222, darke: #222, darkr: #222, darkt: #222, darky: #222, darku: #222, darki: #222, darko: #222, darkp: #222, darkq: #222, darks: #222, darkd: #222, darkf: #222, darkg: #222, );
Other information:
There is some cartesian product made for sass. Then with the cleanCss step, all values are merged.
It look that the cleanCss process make a to big line for android web view to understand it.
the app crash and an opacity: .4 is presented.
Ionic info: (run
ionic info
from a terminal/cmd prompt and paste output below):Copied from original issue: ionic-team/ionic-framework#9465
The text was updated successfully, but these errors were encountered: