Vuetify remove dialog's box shadow - css

I want to remove the box-shadow from the dialog box of vuetify. Image of that -->
In chrome devTools if I set box-shadow to none it works. Like the image below.
But when I am adding a class with box-shadow none, it ain't working. Code for that-->
<v-dialog
v-model="assignedPRPaneldialog"
width="700"
content-class="vDialog"
>
<v-card v-if="GET_PRESS_RELEASE_ASSIGNED_DATA.length > 0">
<!-- {{ GET_PRESS_RELEASE_ASSIGNED_DATA }} -->
<v-card
v-for="(item, i) in GET_PRESS_RELEASE_ASSIGNED_DATA"
:key="i"
class="pa-2"
outlined
>
<CardPr :simple="true" :item="item" />
</v-card>
</v-card>
<v-card v-else>
<v-alert border="bottom" colored-border type="warning" elevation="0">
No Press Release yet.
</v-alert>
</v-card>
</v-dialog>
<style lang="scss" scoped>
div.vDialog {
box-shadow: none;
}
</style>
What should I do here? Thanks in advance.

There are two easy ways I know of to remove box-shadow from v-dialog (and v-menu).
1. Globally:
<style>
.v-dialog {
box-shadow: none;
}
</style>
2. Specific v-dialog (better way):
<v-dialog content-class="elevation-0">
...
</v-dialog>
Notice that it has to be content-class instead of just class.
And if you want to hide the overlay, too:
<v-dialog content-class="elevation-0" hide-overlay>
...
</v-dialog>
References:
v-dialog API, Vuetify Elevation helpers

From this code it's visible that shadow is added on element with .v-dialog class, so you're adding "no-shadow" style to the wrong element.
.v-dialog {
border-radius: 6px;
margin: 24px;
overflow-y: auto;
pointer-events: auto;
transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
width: 100%;
z-index: inherit;
box-shadow: 0px 11px 15px -7px rgb(0 0 0 / 9%), 0px 24px 38px 3px rgb(0 0 0 / 5%), 0px 9px 46px 8px rgb(0 0 0 / 3%);
You can add your class directly to <v-dialog> component, or use elevation-0 class.
EDIT:
If you want to remove dialog's overlay, use hide-overlay prop

Following m4n0's suggestion, found out any class that I use on v-dialog component was applying in the dialog inside v-application--wrap. But as you can see outside application--wrap, there is another v-dialog class is appearing. So currently I removed the scoped property from style, which is now giving me my desired output. Probably targeting the class should be a better option. I will try that out later.
I am not sure though if it is an intended behavior or I made a mistake somewhere.

Related

Conditionally override AntD Select styling in CSS

I have a form that contains an antD Select component.
<Select
name="SeasonId"
onChange={onSeasonChange}
placeholder="Choose Season"
>
// Select Options
</Select>
I want to be able to change the colour of the border (and box shadow) depending on a condition. I am able to change/override the css I need by adding the following into a separate CSS file:
.ant-select-selector:hover {
border-color: #1f9643e5 !important;
}
.ant-select-focused .ant-select-selector,
.ant-select-selector:focus,
.ant-select-selector:active,
.ant-select-open .ant-select-selector {
border-color: #1f9643e5 !important;
outline: 0 !important;
-webkit-box-shadow: 0 0 0 2px rgba(49, 139, 54, 0.342) !important;
box-shadow: 0 0 0 2px rgba(49, 139, 54, 0.342) !important;
}
This changes the styling to what I am after:#
However, I only want to apply this style-override to the Select if a certain condition is met in code (i.e. I have an isEditMode state bool). I may be missing something obvious but interested on hearing any suggestions.
Use a parent class name for your custom CSS code, and apply the class name to a parent element when the condition is true.
Example,
in your CSS file
.example.ant-select-selector:hover {
border-color: #1f9643e5 !important;
}
and in your JSX file,
<div className = {`${conditon ? 'example' :''}`} >
<Select />
</div>

Nativescript-Vue How to make Transparency to Page component who will not affect the childs

Hi i hope you are well.
I have an issue and i couldn't fix it i want to attach a background-image property from url and want to add an opacity with color on it who will not affect the childs.
Actually everything take the opacity if someone can help me it will be great !
Thank you by advance
Here is my sample of code:
<template>
<Page class="ns-light page">
<ActionBar :title="`${actionBarName}`"/>
<StackLayout orientation="vertical" style="text-align: center; margin-top: 5%">
<Label text="Tap to play the music" style="font-weight: bold"/>
<Image :src="src" #tap="playSound" width="300" style="margin-top: 5%"/>
</StackLayout>
</Page>
</template>
<style scoped>
ActionBar {
background-color: #53ba82;
color: #ffffff;
}
.page {
background: url('~/assets/images/cards/background.png') no-repeat center #53ba82;
background-size: cover;
opacity: 0.5;
}
</style>
So thanks to: Tao who took the time to answer me
After trying a lot of things i read the documentation and found out how to do it !
Problematic: "i want an image as a background and a transparent color above the image."
I will explain myself, so i tried to apply css background-image and adding the opacity to it.
The opacity
The opacity is going to modify all of the elements inside your chosen element.
When i used opacity in Page it even changed the opacity of the image and that was not what i was looking for ...
The alpha (rgba)
And then i thought there is alpha = rgba() and you can achieve the transparency of the specific element so = "a color transparent above the image."
So what I did was very simple, I had to see if I could define an rgba class on one of the child elements and i chose: GridLayout (the Layout Container).
So i added a background-color: rgba(0, 255, 0, 0.1) and then i had the color with transparency
And i let the background-image on Page component and that did the trick ! :D
I will put the code of it with the second code over here:
<template>
<Page class="ns-light page">
<ActionBar title="Audio Mémo Manjak - Accueil"/>
<GridLayout width="100%" height="100%" columns="*,*,*,*,*" rows="auto,auto,auto,auto,auto" class="layout">
<StackLayout v-for="(card, index) of cards" :key="index" :col="`${ index % 5 }`" :row="`${ index / 5 }`">
<Image :src="card.src" style="margin: 30px 15px;" #tap="onTappedFun(card)"/>
</StackLayout>
</GridLayout>
</Page>
</template>
<style>
ActionBar {
background-color: #53ba82;
color: #ffffff;
}
.page {
background-image: url("~/assets/images/cards/background.png");
background-position: center;
background-repeat: no-repeat;
background-size: cover;
}
.layout {
background-color: rgba(0, 255, 0, 0.1);
padding-top: 100%;
}
</style>

Angular mat-button-toggle focus overlay color

I have a mat-toggle-button-group in a form:
<form [formGroup]="form" class="mb-4">
<mat-button-toggle-group
name="carrier"
aria-label="Choose Carrier"
#carrierSelection="matButtonToggleGroup"
formControlName="carrierChoice"
[value]="carrierChosen"
>
<mat-button-toggle [value]="carrier" *ngFor="let carrier of carriers">
<img alt="Carrier: {{ carrier | uppercase }}" src="/assets/sending/images/carriers/{{ carrier }}/tab-logo.svg" />
</mat-button-toggle>
</mat-button-toggle-group>
</form>
It insists on showing a heavy black border around the button when it is focused, via tab key or clicked.
I inspect the div <div class="mat-button-toggle-focus-overlay"></div> and find this:
So, first I tried this:
.mat-button-toggle-checked .mat-button-toggle-focus-overlay {
border-bottom: 0 !important;
background-color: transparent !important;
}
No luck still a heavy black line, although inspecting it now shows my overrides:
Which I do not understand.
Next, I try this:
.mat-button-toggle-focus-overlay,
.mat-button-focus-overlay {
box-shadow: var(--focus_shadow) var(--focus);
background-color: transparent !important;
border: 0 !important;
}
When I inspect the <div class="mat-button-toggle-focus-overlay"></div> in the app, it actually shows it has my styles:
But the black line persists.
Apparently, Chrome changed the focus treatment recently and Edge Chromium decided to use a heavy black line for focus.
so I wrapped the toggle group in a DIV and set this:
.carrier-toggle {
.mat-button-toggle-label-content,
.mat-button-toggle-button,
.mat-button-toggle {
outline: none !important;
}
}
and then I set my own focus style, with a background color.
.mat-button-toggle,
.mat-button-toggle-group-appearance-standard .mat-button-toggle + .mat-button-toggle {
&:focus {
background-color: var(--rich200);
border: 0;
}
}

Label and buttons attached to a dropdown in Semantic UI React

How can I have a Label and a Button.Group be attached to a Dropdown in Semantic UI for React?
The attached picture shows what I have currently. If I try using the attached attribute, the label or button group become nested within the dropdown.
Edit: Following is the Semantic UI React markup I currently have:
<Label size='big'>Code</Label>
<Dropdown
options={options}
placeholder='Choose a Patch'
search
selection
allowAdditions
value={value}
/>
<Button.Group>
<Button icon='save' content='Save' color='green' />
<Button.Or />
<Button icon='clone' content='Clone' color='yellow' />
<Button icon='cogs' />
</Button.Group>
I got this to work with semantic-ui-react v2.0.3.
Here's the markup I used:
<Container className='refreshable-dropdown'>
<Dropdown className='left attached refreshable-dropdown' multiple select />
<Button className='refreshable-dropdown' attached='right' icon='refresh' />
</Container>
You can see I added a CSS class called refreshable-dropdown. I added a "refresh" button next to my dropdowns. Here's the CSS classes I used:
/* This is for "fluid" dropdowns that take the whole width of
* their container.
*/
.ui.container.refreshable-dropdown {
display: flex;
flex-flow: row nowrap;
width: 100%
}
/* If you want the dropdown "inline" with other content, apply
* the inline CSS class
*/
.ui.container.refreshable-dropdown.inline {
display: flex-inline;
flex-flow: row nowrap;
}
.ui.attached.dropdown.refreshable-dropdown {
border-right: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.ui.attached.button.refreshable-dropdown {
border: 1px solid #2185d0; /* Specific to my button color */
border-right: none;
box-shadow: none !important;
vertical-align: top;
}
.ui.attached.button.refreshable-dropdown:hover {
border-color: #1678c2; /* Specific to my button color*/
}
Note that I left the select attribute on the Dropdown. This causes some different HTML to be generated than other markdowns, so this may not be 100% applicable to your situation. But I hope it'll at least give you some inspiration for making this work for you. Oh, and here's the resulting dropdown:

Height of tabContainers in dojo

I am using a Dojo tabContainer.
The quick question: do you have to specify the widget size in pixel in the CSS, if you are dealing with a Dojo container?
From what I am seeing, the only way to get a TabContainer to actually show is by giving it an absolute size via CSS.
UPDATE: I figured out that the elements body and html were missing the height attribute, and therefore it was computed to 0. So, now if I set them as 100% I will display the form... but, it will be huge! (as long as the page). The idea is to set its height to auto, so that it's "as long as it needs to be"... is that even possible?
In my HTML I have something like:
...
<body>
<div id="loginForm"> </div>
</body>
...
I then have then in the code:
require(["app/widgets/LoginForm"], function( loginForm){
// Create the "application" object, and places them in the right spot.
loginForm = new LoginForm( {} , 'loginForm');
loginForm.startup();
});
LoginForm is a simple template-based widget with the following template:
<div data-dojo-attach-point="tabContainer" data-dojo-type="app.TabFading" data-dojo-props="tabPosition:'top'" style="height:100%">
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-attach-point="loginPane" data-dojo-props="title: 'Login'">
<form data-dojo-type="dijit.form.Form" data-dojo-attach-point="loginForm" method="POST">
<label for="${id}_login">Login</label>
<input name="login" id="${id}_login" data-dojo-attach-point="login" data-dojo-type="dijit.form.ValidationTextBox" data-dojo-props="required:true"/>
<label for="${id}_password">Password</label>
<input name="password" id="${id}_password0" data-dojo-attach-point="password" data-dojo-type="app.ValidationPassword" />
<input type="submit" data-dojo-attach-point="button" data-dojo-type="app.BusyButton" label="Login!" />
</form>
</div>
</div>
</div>
The CSS is as basic as it gets:
#loginForm {
width: 300px;
margin: 0 auto;
padding: 20px;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
/*** Background Gradient - 2 declarations one for Firefox and one for Webkit ***/
background: -moz-linear-gradient(19% 75% 90deg,#FCFCFC, #CCCCCC);
background:-webkit-gradient(linear, 0% 0%, 0% 100%, from(#FCFCFC), to(#CCCCCC));
/*** Shadow behind the box ***/
-moz-box-shadow:0px -5px 300px #a9a0a0;
-webkit-box-shadow:0px -5px 300px #a9a0a0;
}
body {
background-color: #fcfcfc;
font: 9pt/1.5em Helvetica Neue, Helvetica, Arial, sans-serif;
margin: 0 0;
}
The only way I have to make the TabContainer actually appear is to have height:300px in it -- otherwise, the computed height is 0.
Is this how it's meant to be? Or am I doing something wrong?
If you set the property doLayout to false on either the ContentPane or the TabContainer it should automatically size the height to the content. The doLayout property of the dijit layout containers defaults to true, which then requires a specific height to be applied to it.
Just set the tab container to doLayout="false"
Detail example is here : https://dojotoolkit.org/reference-guide/1.7/dijit/layout/TabContainer.html#examples

Resources