mat-select options became transparent after updating to angular material v7 - angular-material2

I have been working on a web app for the past few weeks and we wanted to make some updates. We updated the project and all of its node modules and when I got everything working again the select drop down's options were transparent and the mat-cards lost their drop shadow.
Did something change in the material update that made the styles act like this?

I updated angular material to 7.2.0 and I noticed the transparent mat-select-panel. Adding some css to my global styles/theme.scss fixed the issue.
You can add this css to your global root css file or add it to the component css file.
I keep all my angular material css in styles/theme.scss file then import it to the component.
Update: I added the prebuilt theme import to my styles/theme.scss file and that pulled in the missing mat-select-panel styles.
#import '~#angular/material/prebuilt-themes/indigo-pink.css';
.mat-select-panel {
background: #fff;
}
.mat-select-panel:not([class*=mat-elevation-z]) {
box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12);
}

The problem is caused by using the css files of Material 5/6 with Material 7.
In my case the css files are imported in index.html from somewhere in /wwwroot/assets/. So upgrading through the cli or package.json was not enough.
In my case the solution was to get the css files of Material 7 from /node_modules/#angular/material/... and overwrite those existing in /wwwroot/assests/.. (these were the old Material 5 css files)

I had the same problem. In my case I had a custom SASS file that imported from #angular/material/theming, the application depended on a CSS generated file from this one.
So after upgrading I had to re-generate the CSS file with node-sass and mat-option-panel wasn't transparent anymore.

For me, the issue was with me COPY/PASTING/MODIFYING some of the code from the github website in order to begin my approach to styling.
/**
* The below is what's available in _theming.scss and what I based my code off of.
* My issue (and I've highlighted the 2 lines, below) was that I had screwed w/ their
* comment and slammed the 2 lines together, screwing w/ the mixins in _theming.scss
*/
$mat-light-theme-background: (
status-bar: map_get($mat-grey, 300),
app-bar: map_get($mat-grey, 100),
background: map_get($mat-grey, 50),
hover: rgba(black, 0.04), // TODO(kara): check style with Material Design UX
card: white,
dialog: white,
disabled-button: rgba(black, 0.12),
raised-button: white,
focused-button: $dark-focused,
selected-button: map_get($mat-grey, 300),
selected-disabled-button: map_get($mat-grey, 400),
disabled-button-toggle: map_get($mat-grey, 200),
unselected-chip: map_get($mat-grey, 300),
disabled-list-option: map_get($mat-grey, 200),
);
I had modified:
hover: rgba(black, 0.04), // TODO(kara): check style with Material Design UX
card: white,
To:
hover: rgba(black, 0.04), // TODO(kara): check style with Material Design UXcard: white,
The result was that the mat-select-panel was not set correctly (nor, I would imagine, was anything else which relied on "card")

Related

St.TextureCache overflowing St.Bin in gnome-shell JS

I'm trying to make a gnome-shell extension where I need to load an image from an URL / URI.
I can do that with St.TextureCache and that works great. I then try to put it in an St.Bin container, but the texture overflows the container (as shown in the screenshot). Is there a way (CSS maybe?) such that this does not happen?
The reason I want that is to give the image rounded corners, with the idea that I can give rounded corners easily to the St.Bin with CSS but it seems I can't style the texture directly. If there is another way to round the corners of the image that is also fine
A screenshot showing the problem. The St.Bin has a red border, but the texture clearly overflows it
The relevant code:
let file = Gio.File.new_for_uri(url_to_picture);
let bin = new St.Bin({
style_class: 'icon-custom',
y_expand: false,
y_align: Clutter.ActorAlign.START,
visible: true,
});
let texture = St.TextureCache.get_default().load_file_async(file, -1, 120, 1, 1);
bin.set_child(texture);
and CSS:
.icon-custom {
border: 3px solid red;
border-radius: 20px;
}

Is there a way to fix custom fonts that are blurry after adding ng-bootstrap?

I'm creating an Angular 7 CLI application that uses ng-bootstrap. Before adding ng-bootstrap, I had custom fonts applied to buttons that were working and showing up nicely. Since adding ng-bootstrap, the fonts are blurry.
I've already tried adding SCSS to the main styles.scss file:
button {
-webkit-font-smoothing: antialiased;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.004);
}
I've also tried:
button {
-webkit-font-smoothing: inherit;
}
In addition, I did add the !important class to try and force it. When I remove the custom font from the button, the default font appears crisp and clear.

How to set active icon colour in Sencha Touch 2.2 Tabpanel app

I've been having difficulty changing the active colour of an icon in my tabpanel item in Sencha Touch 2.2. I've tried lots of variations of CSS and SASS but have not managed to change it. The CSS I have tried:
.x-tabbar.x-docked-bottom .x-tab-active {
color: #000000;
background-color: #000000;
}
.x-tab-active {
background-color: #000000;
color: #000000;
}
I've also tried setting the active colour in SASS, but this doesn't seem to work either. The only bit of CSS that seems to have that blue in it is this bit:
.x-tabbar-light .x-tab-active .x-button-icon::before {
color: #1da2ff;
}
...but when I try setting that to black, nothing happens! Anyone have any ideas how I can change it??
EDIT: I tried the first suggestion changing the CSS to this:
.x-tabbar-light .x-tab-active .x-button-icon {
background-color: #000000;
}
...but this is what I see:
Applying color: #1da2ff; to the :before pseudo-element is the right thing.
The reason why it doesn't work for you is that the rule get overridden by another one with a more specific selector:
.x-tabbar-dark.x-docked-bottom .x-tab-active .x-button-icon:before {
color: #50b7ff;
}
This is the exact situation where using !important is appropriate and not shameful:
.x-button-icon:before {
color: #1da2ff !important;
}
You have the right idea by selecting the icon, which is a span, and not the wrap, which is a div.
The div wrap .x-tab-active has a background color that decides the background of the active box. The icon has an image mask so background color or background-image gradient will determine the color of the icon. There is an additional span that wraps the text, like "x-button-label, for which a color style will change its color.
For changing the color of the icon try:
.x-tabbar-light .x-tab-active .x-button-icon {
background-color: #1da2ff;
}
Thanks a lot, it was enough to add this in my CSS:
.x-tabbar-light.x-docked-bottom .x-tab-active .x-button-icon:before {
color : #000;
}
There was no need to add !important for me as I was using the new base theme for ST 2.2, but your solution worked great!
:-)

IE8 gradient filter not working if a background color exists

I'm trying to use the following CSS styles. They are working on most browsers, including ie7. However in ie8, the transparent background does not show and instead I get the background color which I would like to leave set as a fallback color.
section.rgba{
background-color: #B4B490;
background-color: rgba(200, 0, 104, 0.4);
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490')";
zoom: 1
}
I would like to be able to get this to work without having to resort to an IE stylesheet where i set the background color to none. Is this possible?
Anybody know how to fix it?
After glancing over at CSS3please I realized I was doing overkill with my IE7/IE8 gradient styles. Simply using the following style does the job:
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#444444', EndColorStr='#999999');
Apparently, there is no need for the -ms-filter and zoom rules.
Just adding this as an update - I know the OP got their answer but I found this question while trying to figure out why it (the "fallback") was even "working" in IE7, it confused me no-end so here's what I found out.. it's not working properly in IE6/7...
IE8 is right here, what you're seeing (with the code in the OP) in IE8 is the background color showing through the gradient filter overlay, and as it's the same color that makes the gradient look like it's not working and that all you're getting is the solid color. That's what should happen in all IE's!
IE6 & 7 are incorrectly ignoring the fallback (so it's not really a fallback) and have their transparent background-color because of a bug, purely because the OP has the colors, both hex and RGBa specified using background-color
There are many ways to workaround this.. see: IE Background RGB Bug - and the last comment especially for ways - this workaround would only really be applicable if not using filters/gradients i.e. really using just RGBa (semi-transparent) backgrounds.
If using MS "filter" Gradients to simulate RGBa, The MS filters are stable back to IE5.5 so the reality is that they don't need a fallback and background: none; fed to IE only browsers, to override the fallback required for other browsers (weird huh!) is likely the best solution in the original case - A fallback colour is only necessary for older browser versions of Opera(especially) & Firefox, Safari et al in the case of their gradients/rgba not yet being supported.
It appears, you have to put either width or height to DIV CSS for gradient to work in IE 7+
( at least I had to )
.widget-header {
text-align: center;
font-size: 18px;
font-weight: normal;
font-family: Verdana;
padding: 8px;
color: #D20074;
border-bottom: 1px solid #6F6F6F;
height: 100%;
/* Mozilla: */
background: -moz-linear-gradient(top, #FFFFFF, #E2E2E2);
/* Chrome, Safari:*/
background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#E2E2E2));
/* MSIE */
filter : progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#E2E2E2');
/* Opera 11.10 + */
background-image: -o-linear-gradient(top, #FFFFFF, #E2E2E2);
}
Hope this helps
I found I had to change the <a> element from display:inline to display:block before the filter style would work. Also, the color can be specified with a 4-byte sequence where the first byte is opacity, then rgb, ie. #oorrggbb. Eg.
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffA0C848', endColorstr='#ff70A828');
display:block;
You're using Modernizer wrong. Modernizer places classes on the HTML element; not each individual element. Here's what I used in IE8 to color the SECTION tags.
.rgba section {
background-color: rgba(200, 0, 104, 0.4);
}
.no-rgba section {
background-color: #B4B490;
}
.no-cssgradients section {
filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490');
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#99B4B490',EndColorStr='#99B4B490')";
zoom: 1;
}
The zoom rule is to make sure hasLayout was triggered, your use-case not having a need for it is probably because hasLayout is already being triggered.
regarding the -ms- prefix, according to Microsoft's documentation ( http://msdn.microsoft.com/en-us/library/ms532847(v=vs.85).aspx scroll down to "Downlevel Support and Internet Explorer 4.0 Filters", no anchors I can link to), to target IE8, one should be using the -ms- prefix, to target anything prior to that, one should be using the unprefixed one
#element {
background: -moz-linear-gradient(black, white); /* FF 3.6+ */
background: -ms-linear-gradient(black, white); /* IE10 */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #000000), color-stop(100%, #ffffff)); /* Safari 4+, Chrome 2+ */
background: -webkit-linear-gradient(black, white); /* Safari 5.1+, Chrome 10+ */
background: -o-linear-gradient(black, white); /* Opera 11.10 */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff'); /* IE6 & IE7 */
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr='#000000', endColorstr='#ffffff')"; /* IE8+ */
background: linear-gradient(black, white); /* the standard */
}
The best solution that works for IE7 and IE8 is to use a gradient image and set repeat-x: true while putting it in the background. This works for all browser types that I have found.
you can use the -ms-filter but i guess its the same issue as opacity if you do filter before -ms-filter it fails se more at:
http://www.quirksmode.org/css/opacity.html for that theory
so you need to do like this:
background-color: #D5D6D7;
background-image: linear-gradient(bottom, rgb(213,214,215) 0%, rgb(251,252,252) 100%);
background-image: -o-linear-gradient(bottom, rgb(213,214,215) 0%, rgb(251,252,252) 100%);
background-image: -moz-linear-gradient(bottom, rgb(213,214,215) 0%, rgb(251,252,252) 100%);
background-image: -webkit-linear-gradient(bottom, rgb(213,214,215) 0%, rgb(251,252,252) 100%);
background-image: -ms-linear-gradient(bottom, rgb(213,214,215) 0%, rgb(251,252,252) 100%);
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0, rgb(213,214,215)),
color-stop(1, rgb(251,252,252))
);
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#D5D6D7',EndColorStr='#FBFCFC')";
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#D5D6D7', endColorstr='#FBFCFC');
this works for me
besides that you cant have a 8 char hexcode (hex is latin for six) and on top of this you have the same color to gradient between you have to have different colors

Changing label color for Flex 4 FormItems

Wonder if there is a way to change color for a label in Spark FormItem component. I tried this:
#namespace s "library://ns.adobe.com/flex/spark";
#namespace mx "library://ns.adobe.com/flex/mx";
s|FormItem s|Label#labelDisplay {
color: #333333;
background-color: #FFFFFF;
font-size: 30;
}
and all of the styles work great, except the font color, which stays black for some reason. I would greatly appreciate any help resolving this.
See the answer from Peter DeHaan on my question "Do we need the equivalent of "labelStyleName" property for Spark FormItem class?" http://forums.adobe.com/thread/759374?tstart=0 "Because the color and fontWeight are declared in the default Spark FormItem skin, I believe you will have to create a custom skin if you want to override those styles."

Resources