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.

Allow opting out of Infima styles on one specific page

See original GitHub issue

Have you read the Contributing Guidelines on issues?

Motivation

Modifying the base HTML is currently nearly impossible. There is the injectHtmlTags plugin API that allows tags to be added, but it doesn’t allow anything else, like removing tags, or tweaking the tags based on the current route.

If the ssrTemplate config option could be a function, the base HTML could be modified in any way.

Alternatively, the plugins API could be expanded with an additional function that would allow plugins to tweak all the data that is going to be passed to renderSSRTemplate.

Self-service

  • I’d be willing to do some initial work on this proposal myself.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
alexandernstcommented, Jun 1, 2022

I have a use case where I’d like to render a legacy html (in a particular route) that has it’s own styles / scripts, but Docusaurus’s styles are colliding. I’d like to remove all styles that Docusaurus in injecting in the <head> (only for that route).

0reactions
Josh-Cenacommented, Jun 2, 2022

Ah, if you think it can be deemed as a duplicate, I’m okay to close.

I don’t think removing Infima’s global style pollution is the only way to fix this though:

They are saying, if you have a React page

export default function Home() {
  return (
    <Layout>
      <code>Hey</code>
    </Layout>
  );
}

That <code> tag should not be automatically styled, unless you explicitly opt-into the style somehow; for you, it seems more niche, and you’ll probably be fine with jumping hoops to opt-out of Infima. So they are proposing you should jump hoops to get into Infima styling, while you just want to get out.

But at any rate, this is not a very easy problem to solve😅 We’ll probably just fix the two with the same mechanism.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Styling and Layout - Docusaurus
Infima provides a flexible layout and common UI components styling suitable for content-centric websites (blogs, documentation, landing pages).
Read more >
@docusaurus/plugin-debug | Yarn - Package Manager
We are working hard on Docusaurus v2. If you are new to Docusaurus, try using the new version instead of v1. See the...
Read more >
IEEE Editorial Style Manual for Authors
However, an author may opt out upon review of the proof. The corresponding author(s) name is added in italics at the very end...
Read more >
A Formalization of Dedekind Domains and Class Groups of ...
Dedekind domains and their class groups are notions in commutative algebra that are essential in algebraic number theory.
Read more >
Seven Sketches in Compositionality: - MIT Mathematics
book as a whole. The chapters start out fairly easy and progress in difficulty. Page number. Difficulty. Most math books. Difficulty. Ch. 1....
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