question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

:host not working any more for styling

See original GitHub issue

To customize the style of any material component this worked in the past:

:host {
    md-input {
        .md-input-underline {
            border-top: 1px solid rgba(254, 254, 254, 0.70);
        }
        .md-input-placeholder {
            color: rgba(254, 254, 254, 0.70);
        }
    }
}

After the update the same code, changed with the new component naming does not work:

:host {
    md-input-container {
        
        .mat-input-underline {
            border-top: 1px solid rgba(254, 254, 254, 0.70);
        }

        .mat-input-placeholder {
            color: rgba(254, 254, 254, 0.70);
        }

        .mat-input-ripple {
            background-color: rgba(254, 254, 254, 0.70);
        }

    }
}

What is the recommended way to customise style of material components in isolation?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
grizzm0commented, Feb 7, 2018

@abskr82 No need for :host and it’s ::ng-deep with two “:”.

2reactions
joshwienscommented, Feb 27, 2017

:host /deep/ {
    md-input {
        .md-input-underline {
            border-top: 1px solid rgba(254, 254, 254, 0.70);
        }
        .md-input-placeholder {
            color: rgba(254, 254, 254, 0.70);
        }
    }
}

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular :host <selector> is not working - Stack Overflow
Use the :host pseudo-class selector to target styles in the element that hosts the component (as opposed to targeting elements inside the ...
Read more >
host() - CSS: Cascading Style Sheets - MDN Web Docs
:host() The :host() CSS pseudo-class function selects the shadow host of the shadow DOM containing the CSS it is used inside (so you...
Read more >
5 Common Web Hosting Problems - The Media Temple Blog
These are often related to downtime, layout, or display issues. Though some may seem like common sense, we all forget to clear cache...
Read more >
Angular :host, :host-context, ::ng-deep - The Complete Guide
In this post, we will learn how the default Angular styling mechanism (Emulated Encapsulation) works under the hood, and we will also cover ......
Read more >
How to Troubleshoot CSS Not Working - WPForms
Here's how to troubleshoot when your CSS is not working. ... Since all themes and most plugins contain their own sets of styles, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found