modify the background color at core.scss line 149

I am struggling to change the background color of my Ionic login page. I have tried adding custom CSS in various places, such as core.scss:149, but it only works when I add it directly in Chrome developer tools. How can I get this custom background color to show up by editing the SCSS file for my component?

Here is a snippet of my CSS:

.div-login{
    min-height: 70%;
    margin-left: 10%;
    margin-right: 10%;
    margin-top: 20%;
    border-radius: 30px;
    min-width: 60%;
    background-color: gray;
}

.ion-page {
    background-color: red !important;
}

.loginFields{  
    margin-left: 5%;
    margin-right: 5%;
    border-radius: 10px;
    margin-bottom: 5%;  
}

This is how my HTML is structured:

<div class="div-login">
   <div *ngIf="!registerNewUserVariable">
      <div style="display: flex; justify-content: center; align-items: center;">
         <p style="font-size: 20px;">Login</p>
      </div>
      <div style="display: flex; justify-content: center; align-items: center;">
      </div>
      <div>
         <form (ngSubmit)="login()" [formGroup]="credentials">
         <ion-item class="ion-margin-bottom" class="loginFields">
            <ion-input
               type="email"
               placeholder="Email 🧙"
               formControlName="email"
               ></ion-input>
         </ion-item>
         <ion-item class="ion-margin-bottom" class="loginFields">
            <ion-input
               type="password"
               placeholder="🔒"
               formControlName="password"
               ></ion-input>
         </ion-item>
         </form>
         <p (click)="resetPassword_()" style="font-size: 12px; text-decoration: underline; margin-left: 7%;">Passwort vergessen</p>
      </div>
      <ion-button type="submit" color="warning" class="loginFields" expand="block" [disabled]="!credentials.valid" (click)="login()" style="margin-top: 15%;"> Sign in</ion-button>
      <p style="display: flex; justify-content: center; align-items: center;">📌 connect 📌</p>
      <ion-button color="light" style="display: flex; justify-content: center; align-items: center; margin-left: 10%; margin-right: 10%; margin-top: 10%;" (click)="loginWithGoogle()">
         <ion-icon name="logo-google"></ion-icon>
      </ion-button>
      <div style="display: flex; justify-content: center; align-items: center;">
         <p  (click)="registerNewUser()" style="font-size: 12px; white-space: pre-wrap; text-align: center;">No Email Account?  <br> <b> <u>Okay Lets Goooo</u>🎡  </b>  </p>
      </div>
   </div>
   <div *ngIf="registerNewUserVariable">
      <ion-button (click)="registerNewUser()" style="margin-top: 5%; margin-left: 5%;" color="medium">
         <ion-icon name="arrow-back-outline"></ion-icon>
      </ion-button>
      <div style="display: flex; justify-content: center; align-items: center;">
         <p style="font-size: 20px; white-space: pre-wrap; text-align: center;">nice to meet u </p>
      </div>
      <p style="margin-left: 5%;">Email? </p>
      <form (ngSubmit)="register()" [formGroup]="credentialsRegister">
      <ion-item class="ion-margin-bottom" class="loginFields">
         <ion-input
            type="email"
            placeholder="Email 🧙"
            formControlName="email_"
            ></ion-input>
      </ion-item>
      <p style="margin-left: 5%;"> pw</p>
      <ion-item class="ion-margin-bottom" class="loginFields">
         <ion-input
            type="password"
            placeholder="🔒"
            formControlName="password_"
            ></ion-input>
      </ion-item>
      <ion-item class="ion-margin-bottom" class="loginFields">
         <ion-input
            type="password"
            placeholder="🔒 check"
            formControlName="passwordCheck_"
            ></ion-input>
      </ion-item>
      </form>
      <ion-button type="submit" color="warning" class="loginFields" expand="block" (click)="register()" style="margin-top: 15%;"> Register</ion-button>
   </div>
</div>

Answer â„–1

Make sure to include !important in your background-color declaration as shown below

.element-background {
background-color: blue !important;
}

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

Issues arise with PrimeNG multiselect onItemClick functionality following an update to version 7

I am currently working with a MultiSelectComponent that extends the primeng MultiSelect functionality. Recently, I updated from version 6.1.6 to 7.0.4. <ul class="not-important" <li *ngFor="let option of options; let i = index" class="not-import ...

I am struggling to move my dropdown list in HTML and CSS

I'm having trouble adjusting the position of a dropdown list on my website using CSS. Can someone help me move the dropdown list to the center? HTML Code: <header> <h1 id="my_cycle_head">MY CYCLE</h1> <ul id= ...

The ngx-datatable is experiencing issues with rendering rows correctly within a tab set

My angular Component (Country Component) has 3 child components as Tab (States, Population, Industries). The Parent Component contains a drop down called 'Country List' which controls the data shown in the tab. Upon loading, no country is selecte ...

Strategies for Managing Output Event Prioritization in Angular Using RxJs Based on Trigger Sequence

Within my Angular Application, there is a widget with two event outputs originating from a third-party library. Unfortunately, I am unable to modify its behavior. <myWidget (onAlwaysEvent)="onAlwaysEvent($event)" (onSometimesEvent)="onSometimesEven ...

tips for creating a mobile-friendly responsive button

I have been scouring the internet for a solution to this issue. Essentially, I am trying to position the button on the right side in desktop view. Here is an example: chrome view However, when the site is resized or viewed on mobile devices, the button sh ...

Swap out the default URL in components with the global constant

Could anyone offer some assistance with this task I have at hand: Let's imagine we have a global constant 'env' that I need to use to replace template URLs in components during build time. Each component has a default template URL, but for ...

Codelyzer is optimized for Angular 9 and doesn't currently support Angular 10

Whenever I run the command npm ls -json in my Node.js project, I encounter the following error: npm ERR! missing: @angular/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5e3d312c3b2e68797169717967">[email protected]< ...

Ways to incorporate gradual transparency to an element using HTML and CSS

I have a list item that I want to visually disappear into the horizon during a JavaScript event. I am not looking to animate it, more like applying a filter effect. Is there a way in HTML/CSS/JavaScript to dynamically add gradual transparency without chang ...

Testing the method in Angular using Jasmine is not possible due to the presence of a spy

Within my component, I have several concrete methods: public show(summary: GridSummary) { this.resetModal(summary); this.summary.direction = this.summary.direction || 'Response'; this.title = this.getTitle(summary); this.parentId ...

Page load triggers background color shift

Here is the structure of my markup: <div class="authentication"> <div class="form-inputs"></div> </div> My goal is to have the color of the authentication section slide down from top to bottom when the page loads. Initially, the ...

Tips for transferring data between two pop-up windows in Angular2

My Angular2 project has a specific requirement that involves opening a first popup for users to enter some values. Upon a user event, like clicking a button, the first popup should close and a second popup should open with the values pre-populated from the ...

Observe that the variable fails to update within the error handling code when utilizing httpclient

My application has an authentication service that handles user logins. The login functionality is implemented in the login() function within my login component: public login() { const val = this.form.value; if (!this.email.invalid && !t ...

Pass the input value directly to typescript without the need for a send button

I am looking to capture user input from a regular text box: <form> <input type="text" oninput="sendInput()" /> </form> My goal is to send the user's typed input directly to a typescript file without the need for a submit button ...

Style binding for background image can utilize computed properties or data for dynamic rendering

In my code, I am trying to pass an object that contains a string path for its background image. I have experimented with using data and computed properties, but so far I haven't had any luck getting them to work within the :style binding. However, if ...

Ways to eliminate whitespace in React and Bootstrap 5

I have a pet project that requires mobile responsiveness, and I'm encountering an issue with white space in the Carousel component. I am unsure of how to remove it - can anyone provide assistance? Here is how the page looks on PC: https://i.sstatic.n ...

Why does Angular Redirection initiate both my method and NgOnInit?

As a beginner in Angular, I am encountering an issue with Angular Redirection. Whenever I manually clear storage, the code executes ngOnInit, prompts an error, and redirects to the Login page as expected. However, when I attempt to do the same using the lo ...

Expand picture when grid is selected

I am facing a challenge with my thumbnail grid. I want to enlarge an image slightly without disrupting the layout of the grid. I have experimented with different approaches, first focusing on displaying the enlarged image and then on maintaining the fluid ...

Implementing CSS styling within a JavaScript file

I have a vague memory of an easy way to incorporate CSS code within a JS file, but I can't recall the specific details. Simply inserting CSS code into a JS file doesn't seem to work, so there may be a need for comments or some other method. *No ...

I am encountering an issue with opening a dropdown select option upon clicking in C# while using Selenium

I am encountering an issue while attempting to open the Register page from my account. The UI developer utilized Bootstrap code, and Bootstrap developers have included a JS function on click. However, when I execute this code, an error is thrown: "OpenQA.S ...

What could be causing the Navbar Collapse feature to malfunction in my Bootstrap setup?

Hey there, I'm facing an issue with the Bootstrap navbar collapse button not working. I've tried everything, followed all the steps in a tutorial, but still can't get it to function properly without altering the Signup and Login buttons. Ca ...