How do I change the font color using SCSS when it has an imported stylesheet in Angular 8?

TMR

I am not able to change any font/text colors in my div (using the standard methods), and I think the import of "...theme.scss" is blocking these changes (?), I have never used SCSS. Specifically I want to change just the phone numbers (all) text to red. I can make other changes, so I know the .scss is hooked up. I would like to add the red text to an existing style if possible.

html...

<div class="contact">
  <h1>Contact Us</h1>
  <div class="contact-footer">
    <p><strong>For any other questions, please contact...</strong></p>
    <div class="contact-footer-container">
      <div class="contact-subcontainer">
      <div class="contact-card"><p>Publications<br>Phone: <a href="tel:1-800-123-4567">1-800-123-4567</a><br> <a href="[email protected]">[email protected]</a></p></div>
      <div class="contact-card"><p>Product Support<br>Toll-Free: <a href="tel:1-800-123-4567">1-800-123-4567</a><br>
        Direct: <a href="tel:1-000-123-4567"> 1-000-123-4567</a><br> Fax:  1-000-123-4567
    </div>
    </div>
  </div>
</div>

component.scss...


@import '~@angular/material/theming';
@import '../../some-material-theme.scss';


p {
    font-family: $font-family;
    font-size: $text-medium;
}

.contact-footer {
    background-color: lightgray;
    padding: 8px;
    margin: 15px;
}
.contact-footer-container {
    display: flex;
    flex-flow: row;
}
.contact-subcontainer {
    display: flex;
    flex-flow: row;
    flex-grow: 1;
}
.contact-card {
    flex-grow: 1;
    padding: 15px;
    padding-top: 0;
}
.contact-card > p {
    line-height: 150%;
}
mat-icon {
    font-size: 18px;
}
a {    
    text-decoration: none;
}

iProgramGUIs

This should work... in component.scss file

.red-text {
color: red;
}

in template

<a href="tel:1-800-123-4567" class="red-text">1-800-123-4567</a>

if that doesn't work then there's an issue somewhere else in your code, maybe the scss is not being loaded in @Component or something like that.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

How do I change the font color in an html table?

分類Dev

How do I change the font color of the warning box in VIM?

分類Dev

How do I change the color of a tab when the sum of cells =0

分類Dev

How do I change the default Chinese font?

分類Dev

How do I change the default Chinese font?

分類Dev

How to change font color on scroll in bootstrap using Jquery?

分類Dev

how can I do change color of text when pressed / after that press / again? like comment in visual

分類Dev

Change font color in ul li using class

分類Dev

How do I change the default font to "Ubuntu" on OpenOffice.org?

分類Dev

How do I print with the screen stylesheet?

分類Dev

How to change Font color for disabled TComboBox (Delphi)?

分類Dev

How change font color of Hyperlink in DataGrid

分類Dev

How do I change the color of desktop icon text

分類Dev

How do I change the color of one vertex instead of all of them?

分類Dev

How do I change the color of the ActionBar hamburger icon?

分類Dev

How do I change button color in Ionic Framework

分類Dev

How do I implement option buttons and change the button color in PyGame?

分類Dev

How do I change the entire background color in an RMarkdown HTML Document?

分類Dev

How do I change xterm's menu background color?

分類Dev

How Can I change color of the container when it is active or inactive in a ListView

分類Dev

Can't figure out how to change font color, using jQuery (trying to build a simple menu)

分類Dev

How do I change this value using regex?

分類Dev

How do I change the background image of a UICollectionViewCell that has been tapped?

分類Dev

How can I change color of tinymce background onchange using query

分類Dev

localStorage change font color

分類Dev

How do I change Button Text color onclick event(asp.net, C#)using Css file?

分類Dev

Do I need to change my font stack when a web page is viewed on a high DPI Tablet or computer?

分類Dev

How do I force the font color to remain the way it is rather than changing

分類Dev

Can I change the color of Angular Material checkbox with some custom color and how?

Related 関連記事

  1. 1

    How do I change the font color in an html table?

  2. 2

    How do I change the font color of the warning box in VIM?

  3. 3

    How do I change the color of a tab when the sum of cells =0

  4. 4

    How do I change the default Chinese font?

  5. 5

    How do I change the default Chinese font?

  6. 6

    How to change font color on scroll in bootstrap using Jquery?

  7. 7

    how can I do change color of text when pressed / after that press / again? like comment in visual

  8. 8

    Change font color in ul li using class

  9. 9

    How do I change the default font to "Ubuntu" on OpenOffice.org?

  10. 10

    How do I print with the screen stylesheet?

  11. 11

    How to change Font color for disabled TComboBox (Delphi)?

  12. 12

    How change font color of Hyperlink in DataGrid

  13. 13

    How do I change the color of desktop icon text

  14. 14

    How do I change the color of one vertex instead of all of them?

  15. 15

    How do I change the color of the ActionBar hamburger icon?

  16. 16

    How do I change button color in Ionic Framework

  17. 17

    How do I implement option buttons and change the button color in PyGame?

  18. 18

    How do I change the entire background color in an RMarkdown HTML Document?

  19. 19

    How do I change xterm's menu background color?

  20. 20

    How Can I change color of the container when it is active or inactive in a ListView

  21. 21

    Can't figure out how to change font color, using jQuery (trying to build a simple menu)

  22. 22

    How do I change this value using regex?

  23. 23

    How do I change the background image of a UICollectionViewCell that has been tapped?

  24. 24

    How can I change color of tinymce background onchange using query

  25. 25

    localStorage change font color

  26. 26

    How do I change Button Text color onclick event(asp.net, C#)using Css file?

  27. 27

    Do I need to change my font stack when a web page is viewed on a high DPI Tablet or computer?

  28. 28

    How do I force the font color to remain the way it is rather than changing

  29. 29

    Can I change the color of Angular Material checkbox with some custom color and how?

ホットタグ

アーカイブ