Changing Background Color of Modal for angular_components - angular-dart

How do you customize the background color of the ModalComponent in angular_components for dart?
Question pulled from here: https://github.com/dart-lang/angular_components/issues/187

Changing the dialog colors for modals and other dialogs is as simple as changing the CSS. For example:
CSS:
.blue-dialog {
background-color: blue;
}
HTML:
<material-button (trigger)="showBasicDialog = true"
[disabled]="showBasicDialog"
raised>
Open Basic Dialog
</material-button>
<modal [visible]="showBasicDialog">
<material-dialog class="blue-dialog">My Blue Dialog</material-dialog>
</modal>

Related

Ion Refresher color Icon does not change ionic 5 (stencil)

How can I customize the the styles of ionic refresher spinner icon in ionic 5?
I am working on an app with lightmode and darkmode. In lightmode the spinner is displayed in a dark grey on white background. So far so good. But if I switch to darkmode, it is displayed white on white. I tried to change the color f.e. with
<ion-refresher slot="fixed">
<ion-refresher-content color="primary" refreshing-spinner="crescent">
</ion-refresher-content>
or SCSS
ion-refresher {
ion-refresher-content {
--color: red;
}
}
ion-refresher {
ion-refresher-content {
color: red;
}
}
and setting the variable to
$refresher-icon-color: red;
I would really appreciate some help.
Thank you!
you need to some CSS to get this done. i have added a CSS code below you can add this in your global.css file and you can remove the color option from ion-refresher-content color="primary"
//add this css code in your global.scss file which in your src folder
ion-refresher.refresher-native ion-spinner{
color: red!important;
}

How to set IONIC4 set tabs background transparent?

I use ionic4 now. And my client and his designer give a picture like below.
It need to make tabs has transparent but I don't know how to set. I have try to add in variables.scss but the transparent is no working. If only change color is work.
.ion-color-tabstrans {
--ion-color-base: rgba(100,100,100,0.1);;
}
From the tab-bar docs seems like you can change the background by using the --background CSS property like this:
HTML
<ion-tabs>
<!-- Tab bar -->
<ion-tab-bar class="my-custom-tab-bar" slot="bottom">
<ion-tab-button tab="account">
<ion-icon name="person"></ion-icon>
</ion-tab-button>
<ion-tab-button tab="contact">
<ion-icon name="call"></ion-icon>
</ion-tab-button>
<ion-tab-button tab="settings">
<ion-icon name="settings"></ion-icon>
</ion-tab-button>
</ion-tab-bar>
</ion-tabs>
SCSS
ion-tab-bar.my-custom-tab-bar {
--background: rgba(100,100,100,0.1);
}
EDIT
You'd probably need to change the background of the ion-tab-button as well
ion-tab-bar.my-custom-tab-bar ion-tab-button {
--background: transparent;
}
EDIT II
The answer above is correct, but is missing something that makes everything not to work as expected. The problem is that the ion-tabs element is placed outside of the element that represents the content. What you need based on your question is to place the tabs above the content instead.
One way to do that is by setting the positioning of the ion-tabs to be absolute, like this:
HTML
<ion-tabs>
<!-- I've added a my-custom-tab-bar class to the ion-tab-bar element -->
<ion-tab-bar class="my-custom-tab-bar">
<!-- ... -->
</ion-tab-bar>
</ion-tabs>
SCSS
ion-tab-bar.my-custom-tab-bar {
position: absolute;
bottom: 0;
width: 100%;
--background: rgba(255,255,255,0.8);
ion-tab-button {
--background: transparent;
}
}
That produces this result:
Notes
Please notice that since the tabs are above the content, you will need to add some margin-bottom to the content of each page that is used as a tab.
Also please double check if setting the positioning of the tabs to be absolute doesn't break the layout specially in devices with a safe-area at the bottom like the iPhone X.

How to apply background color for a full page in ionic

How to apply background color for a full page in ionic
I used a code HTML
<ion-content padding class="bg.style">
in css
.bg-style {
background-color: #dddddd;
}
but I didn't get output please help me
try doing this
<ion-item>
<div class="item-content">
</div>
</ion-item>
The Ionic CSS contains a CSS property:
.item-content {
background-color:#ffffff;
}
The inline CSS you added is being applied to the element behind the element with the #ffffff background, so you can't see your background color.
Apply the background color to the .item-content element, as by adding the following CSS to the Ionic CSS file, or create a custom CSS file and include a to it in the header, with the following:
.item .item-content {
background-color: transparent !important;
}
Here's the working.demo

change the color for item-icon in sidemenu in ionic when it is activated

In the Ionic app, I need to change the background color for my side menu to become red . By default , when I click or press on one item stable color become the background color but I need to become red .
see this
You can use sass to build your own custumized ionic.css
You can give custom css to set the background color like <ion-content class="dark">
Css
.dark {
background-color: red !important;
color: #ffffff;
}
Sample HTML
<ion-side-menu side="left">
<ion-header-bar class="bar bar-dark">
<h1 class="title">Left Menu</h1>
</ion-header-bar>
<ion-content class="dark">
<ion-list class="list">
<ion-item href="#/event/check-in">Check-in</ion-item>
<ion-item href="#/event/attendees">Attendees</ion-item>
</ion-list>
</ion-content>
</ion-side-menu>
You can check the full code/demo on the codpen which have proper comments also : http://codepen.io/mhartington/pen/qafgv
For the other reference you can check this also : http://pointdeveloper.com/ionic-change-side-menu-color/
Try overriding item.active.item-stable and item.activated.item-stable styles in your custom CSS.
Add below styles in your custom CSS:
.item.active.item-stable, .item.activated.item-stable, .item-complex.active .item-content.item-stable, .item-complex.activated .item-content.item-stable, .item .item-content.active.item-stable, .item .item-content.activated.item-stable{
border-color: #B81D22;
background-color: #B81D22;
}

is it possible to hide :hover element (pure css) when tapping outside again on iPhone?

I use double tap (on iPhone) on :hover elements to show extra information, without javascript, just simple css :hover pseudoclass. Now I've the problem that the div, that appears on :hover doesn't disappear anymore, only if I tap on another :hover element.
Has the :hover-functionality changed in iOS?
li.to-be-hovered {
position:relative;
}
li.to-be-hovered div.hidden {
display:none;
}
li.to-be-hovered:hover div.hidden {
display:block;
position:absolute;
}
And some more like width, top, left, margin, background, z-index and so on...
<div>
<ul>
<li class="to-be-hovered">
<div class="hidden">
lots of extra information with image, span, link elements
</div>
</li>
</ul>
</div>
On my iPhone (4S) the div.hidden appears at first tab on div.to-be-hovered, but doesn't disappear anymore when tapping somewhere else outside the element.
Does anybody know this effect? Is it possible to make it disappear again with pure CSS or do I have to use Javascript for all these elements?
simple and no javascript needed.
Here's the fix
add this to your css mediaquery
body {cursor: pointer}
JS:
var hidestuff = function() {
// Hide lots of extra information with image, span, link elements
// $(elm).hide();
}
$('html').touch(hidestuff).click(hidestuff);
CSS:
.hidestuff { position: absolute; z-index:1}
So, if user touch anywhere but the element in need to tap, the "hidestuff" will be hidden
Hope this helps :/