Skip to content

Adopt --code-font-family#6997

Merged
ludeeus merged 20 commits intohome-assistant:devfrom
KTibow:patch-7
Sep 21, 2020
Merged

Adopt --code-font-family#6997
ludeeus merged 20 commits intohome-assistant:devfrom
KTibow:patch-7

Conversation

@KTibow
Copy link
Contributor

@KTibow KTibow commented Sep 14, 2020

Proposed change

This makes more cards use the new --code-font-family variable for their <pre> tags.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Kinda both... The feature isn't new, I've added this for the code editor before, so it fixes the bug of partial adoption, but it could also be that it's making the new feature complete.

Example configuration

frontend:
  themes:
    comicsanscode:
      code-font-family: Comic Sans MS

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

@ludeeus
Copy link
Member

ludeeus commented Sep 14, 2020

You can skip some places by adding it to ha-markdown instead.

@KTibow
Copy link
Contributor Author

KTibow commented Sep 14, 2020

How could I do that?

@ludeeus
Copy link
Member

ludeeus commented Sep 14, 2020

diff --git a/src/components/ha-markdown.ts b/src/components/ha-markdown.ts
index 978a9797..484776a2 100644
--- a/src/components/ha-markdown.ts
+++ b/src/components/ha-markdown.ts
@@ -72,6 +72,7 @@ class HaMarkdown extends LitElement {
         padding: 16px;
         overflow: auto;
         line-height: 1.45;
+        font-family: var(--code-font-family, monospace);
       }
       ha-markdown-element h2 {
         font-size: 1.5em;

@KTibow
Copy link
Contributor Author

KTibow commented Sep 14, 2020

Thanks for the tip. Now how can I remove redundant code?

@ludeeus
Copy link
Member

ludeeus commented Sep 14, 2020

The same way you added it?

@KTibow
Copy link
Contributor Author

KTibow commented Sep 14, 2020

I don't want to remove it in places where it's actually needed. Just curious if you had some guidance.

@KTibow
Copy link
Contributor Author

KTibow commented Sep 14, 2020

Manually looked through all files, couldn't find any places where I could skip it.

@KTibow KTibow requested a review from ludeeus September 16, 2020 18:29
@ludeeus ludeeus merged commit 4b84696 into home-assistant:dev Sep 21, 2020
@bramkragten bramkragten mentioned this pull request Sep 30, 2020
@KTibow KTibow deleted the patch-7 branch November 7, 2020 18:47
@github-actions github-actions bot locked and limited conversation to collaborators Jul 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants