Closed itisafrickinhighlander closed 3 years ago
restart of an app
This should not be required.
Is there a way I can toubleshoot a possible error there?
Errors should be logged. If not logged then were not produced. There is no related code in the app that would be ignoring/suppressing the errors (would be a very bad practice).
The app doesn't log the custom css content. It only puts removing custom css / inserting custom css
-like records to the log file in verbose
mode. The app also logs the browser console messages of warn + error
levels. So maybe enable the warn
log level in the app (or any other level other that error
, since it's the lowest level) and see if something useful gets into the log file (warn messages are those lines that browsers print to dev console in yellow color).
Update: I have just noticed there is one part which works, it is
So it gets applied at least. The applying mechanism is at the @electron side. I initially thought I will dynamically generate the <link rel="stylesheet" type="text/css">
-like tag and put it into the DOM/head but noticed @electron has built-in method for this purpose, it's https://www.electronjs.org/docs/api/webview-tag#webviewinsertcsscss (see <webview>.insertCSS(css)
). So if some css works in regular browser but doesn't work in webview then so far I tend to think it's @electron's / upstream issue.
Do you reckon it is a bug or just a lack of proper implementation? I did also notice there is a couple of small things which were also applied, e.g. reordering and justifying of email control buttons (filter, move, label, unread, remove, reply/all/forward) or applying bold for From:/To: in email details, but nothing else, so resizing of anything wasn't applied at all, manipulating with icons (removing background, rescaling) and adding/removing padding of some elements either didn't work.
.toolbar { height: 4rem; }
not even this works. Is it possible there is an underlying issue of some sort?
I just tested that selector and I see in dev console that it's marked as injected stylesheet
. I then made the selector more specific by transforming it to .content-container .toolbar
and then the height: 4rem
rule got applied since it took priority over default/proton .toolbar
selector's rules.
If I understand it correctly then, this is a matter of conflicts between Electron/Chromium and PM client?
And with that...adding !important to every single entry fixed this, it is working now. It is dirty as hell, but it works.
It looks more like a need to prioritize the stylesheets selectors since it appears that the proton's selectors take priority on injected stylesheet
selectors (the kind of styles normally applied by browser extensions/addons). So just define more specific selectors and it should work fine then.
If I may to slightly re-open the topic. I haven't found the way to adopt CSS as a whole to this, so I had to stick with !important arguments, however there is one section I cannot overcome
.composer {
right: 8px !important;
height: 700px;
width: calc((100% + var(--width-sidebar, 19rem)) * 0.40);
}
which is changing composer window and height: 700px; will be ignored as expected, but I cannot use !important argument there or else I will break the minimize window functionality (I would basically tell it to stay at 700px height no matter what, it would be the same if I did it so in the browser). Would you mind me asking if you see how I could address .composer without interfering with some built-in CSS in Electron?
I will break the minimize window functionality
You can see in the dev console that the .composer
element dynamically gets composer--is-minimized
/ composer--is-maximized
classes. So try something like this:
.composer:not(.composer--is-minimized) {
...
}
Works perfectly, thank you very much.
I have prepared a custom CSS code to inject into ElectronMail. It is working when injecting it via developer console in FF and also when adding it via Stylus extension, however when I copy it over to Custom CSS in Electron Mail, hit update, nothing happens. I try restart of an app, also doesn't work. I tried to grep "css" in log.log, but there is no mention of it.
Is there a way I can toubleshoot a possible error there?
Here is also the aforementioned CSS code:
I have also tried to apply just a single snippet, e.g.
not even this works. Is it possible there is an underlying issue of some sort?
Update: I have just noticed there is one part which works, it is
it hides "Special Offer" button (probably "Upgrade" for free users as well).