Building a custom dialog box using Angular Material with HTML and CSS

I've been exploring different approaches to create a customized angular material dialog with a unique header using CSS/SCSS and the TailwindCSS framework. I am aiming for a specific visual effect, similar to what is shown in the figure below.

desired-effect

However, despite numerous attempts, I have only managed to achieve the following result:

current-effect

My main challenge lies in filling the white area beneath the header and applying a yellow background color to the material icon. Below is a snippet of my HTML/CSS code:

CODE:

<div class="w-full bg-gray-50 dark:bg-gray-900">

    <div class="edit-dialog-header">
        <div class="edit-dialog-header-title pl-5 pr-10 pt-4 uppercase w-max" fxLayout="row" fxLayoutAlign="start">
            <div class="font-bold">Dialog title</div>
            <span class="edit-dialog-button-exit">
                <button class="p-1" [mat-dialog-close]
                        matTooltip="Close"
                        mat-icon-button>
                    <mat-icon>close</mat-icon>
                </button>
            </span>
        </div>

        <div class="edit-dialog-header-subtitle pl-5 pr-5 uppercase">Dialog subtitle</div>

        <div class="grid justify-items-center edit-dialog-header-footer">
            <mat-icon class="material-icons-round badge w-10 h-10">link</mat-icon>
        </div>
    </div>
    
    <div> Some Content ... </div>
</div>
.mat-dialog-container {
    padding: 0px;
    position: relative;
}

.mat-dialog-content {
    margin: 20px;
}

.edit-dialog-header {
    background-color: #929aa0;

    .edit-dialog-header-footer {
        background: #ffffff;
        background: linear-gradient(0deg, #ffffff 50%, rgba(146, 154, 160, 1) 50%);

        mat-icon {
            font-size: 20px;
        }

    }

    .edit-dialog-header-title, .edit-dialog-header-subtitle {
        color: #fbfbfd;
    }

    .edit-dialog-header-title {
        font-size: x-large;
    }

    .edit-dialog-header-subtitle {
        font-size: medium;
        font-weight: normal;
    }

    .edit-dialog-button-exit {
        button {
            position: absolute;
            top: 0;
            right: 0;
            border: none;
            background-color: #929aa0;

            mat-icon {
                color: #fbfbfd;
            }
        }
    }
}

.badge {
    font-weight: bold;
    color: #fbfbfd;
    background: #929aa0;
    border-radius: 50%;
    padding: 5px;
    line-height: 50px;
    vertical-align: middle;
    text-align: center;
}

Is there anyone out there who has some insights on how I can address the issue of the white space below the header? Your input would be greatly appreciated. Thank you!

Answer №1

Consider implementing the z-index: 10 property within your CSS rule.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the reason for the excessive width of the final column in this table?

I am currently working with a dataset that I am displaying using the handsontable library in the form of a table. One issue I am facing is that the last column of my table appears too wide even though I did not specify any width for it. Below you can see t ...

What is the necessity of ngrx/store when services and localStorages are available for use?

When it comes to Angular, we rely on ngrx/store to manage the state. However, I question whether all tasks can be effectively handled using services alone. What benefits does implementing the ngrx/store package offer? Your insights would be greatly appre ...

Angular and WEB API experiencing issues with the update function synchronization

Currently, I'm developing a CRUD example using dotnet core and Angular. In the backend, I have implemented a function in the CarController.cs as shown below: CarController.cs [Route("UpdateCar")] [HttpPut] public IActionResult Put([ ...

Angular binding for selecting all data

Upon checking a checkbox for a single item, the bound data is retrieved and added to an array. However, this does not happen when using selectAll. Code snippet in Angular for obtaining the object of a checked item: $scope.selectedOrganisations = []; $sco ...

Transferring data to Spring-Boot's RestController using Angular 2 and JSON_Format

Currently utilizing an H2 database, I aim to register a user and view it in the database. (BackEnd Module) Spring-Boot is active on port 8080 while Angular 2 (FrontEnd Module) is operational on port 3000. (FRONTEND) @Injectable() export class RegisterSe ...

Add space between the first and second rows in the grid gallery display

.gallery{ display: grid; grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) ); grid-template-rows: repeat( auto-fit, minmax(250px, 1fr) ); } view grid image here Could you assist me with identifying the spacing issue between the first and second ...

Ways to show text on top of an image using CSS

Seeking help! I'm attempting to overlay some text on top of an image, here's the link: http://jsfiddle.net/5AUMA/31/ The challenge is aligning this text to the bottom part of the image. I've tried using this CSS: .head_img p { position ...

Assign a class to an Angular component's host element without any conditions

In my Angular project, I have a component where I need to apply a class unconditionally. To achieve this, the host property within the @Component decorator can be used: import { Component } from '@angular/core'; @Component({ selector: 'ap ...

Implementing image max-width and maintaining aspect ratios for responsiveness

Within the code snippet below and utilizing Bootstrap, a grid layout is defined with several .block components, each comprising an image and a title. The images are designed to be larger than the column size so that they can expand to full width for respon ...

Is there a way to prevent the splash screen from appearing every time I navigate using a navbar link in a single page application (SPA)?

Recently, I came across this tutorial and followed it diligently. Everything seemed to be working perfectly until I encountered an issue with my navbar links. Each time I clicked on a link, the splash screen appeared, refreshing the page without directing ...

Having trouble fetching values from an object in Angular? Receive an undefined result

Currently, I am attempting to extract values from a backend object. The initial demonstration works fine: export class Test { public StringValue: string | undefined; public BoolValue: boolean | undefined; public TestList: Array<User>; } Additi ...

How to assign a value to a textarea element in an HTML form?

I am struggling to populate a text area with the value using this code snippet... <?php $message = $_REQUEST['message']; ?> <br/><b>Description</b><br/> <TEXTAREA NAME="message" COLS=40 ROWS=6 value="<?=$messa ...

Ways to remove redundant code from multiple service calls

Within my DataService, I have set up an observable for various API calls. I am looking to streamline the process by creating a reusable block of code to be used in each HTTP request. export class DataService { constructor( private http: HttpClient, ...

Issues with Angular displaying filter incorrectly

Whenever a user chooses a tag, I want to show only the posts that have that specific tag. For instance, if a user selects the '#C#' tag, only posts with this tag should be displayed. This is how my system is set up: I have an array of blogs that ...

Encountering problems while attempting to npm install on Windows with Git Bash for Angular.io's quick start tutorial

I am attempting to perform an npm install on windows for the Angular.io quick start, available at: https://angular.io/docs/ts/latest/guide/setup.html However, I encountered a git bash error after cloning the repository: shasum check failed for... This i ...

What is the best way to loop through an array and apply classes to each element separately?

I'm currently working on a unique jQuery plugin that is designed to create dynamic lists based on any data provided. The first 6 items in the list will always remain constant, regardless of the input data. When I say constant, I mean that although th ...

Endless Loop Seamless Vertical JavaScript Experience

I've been working with an HTML table structure of data and was successful in setting up a vertical list loop using some JavaScript. However, I'm facing challenges in achieving a smooth constant vertical scroll. Currently, it goes row by row when ...

Mastering the art of calculating the width for a responsive scroll menu

I found a useful tutorial on building a scrolling menu for smaller screen sizes. You can check it out here. However, I encountered an issue when trying to add a border width element. Whenever I define the width, it overrides the scrolling: auto; element. ...

I am experiencing difficulties with my HTML and CSS code not functioning as I had initially intended

I've been dabbling in HTML and attempting to create my own website, but I'm encountering an issue with the positioning of my <table> tag. It keeps appearing at the bottom of the site, despite my CSS instructions to prevent it. The position ...

Create a PDF document using the combined HTML content

I am facing an issue with generating a PDF from HTML content. My goal is to convert all the content within a specific div into a PDF. I have tested out a few converters, but they only seem to convert HTML files. I do not want to convert the entire HTML fi ...