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.

SSR styles have precedent issues

See original GitHub issue

Bug Report

What is the expected behavior?

Using [ngStyle.xs]=“{‘display’: ‘none’}” and [ngStyle.lg]=“{‘display’: ‘block’}” would create 2 @media styles for the 2 respective sizes.

What is the current behavior?

Actually, you get the 2 above plus an inline style ‘display’: ‘none’ that overrides everything. If I remove the inline style, the issue goes away and things appear to work as expected.

What are the steps to reproduce?

Providing a StackBlitz (or similar) is the best way to get the team to see your issue.

Hard to use a StackBlitz for this as it is an SSR related issue.

What is the use-case or motivation for changing an existing behavior?

Avoid FOUC

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular 8.2.9 Angular-Flex 8.0.0-beta.27 Angular Material 8.2.2 Typescript 3.5.3 Windows Chrome Latest (All Browsers woudl be affected)

Is there anything else we should know?

I have a feeling 'm doing something wrong here because I’ve tried a long list of ways to get SSR working as I would expect to no avail.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rkajbafcommented, Oct 25, 2019

Sorry to pile on here… but I see related looking issues in using ngShow/ngHide as well…

0reactions
angular-automatic-lock-bot[bot]commented, Jan 29, 2022

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Usage - styled-components
In the above example the styled component class takes precedence over the global class, since styled-components injects its styles during runtime at the...
Read more >
Emotion 10: CSS-in-JS with Flexible Scoped and Global ...
Style precedence is now fixed and documented in Emotion 10.0. The precedence rules are chosen so that components with styles defined on ...
Read more >
Next.js: The Good, Bad and Ugly - An Idiosyncratic Blog
Next.js is a framework for SSG SSR apps. But it is not all sunshine and rainbows. ... There are issues I faced when...
Read more >
T286963 Prototype a Vue SSR implementation using a Node ...
The Structured Data team has already complained about this issue (they had to move styles out of their .vue files to make them...
Read more >
CSS-in-JS - vite-plugin-ssr
This enables us to add the styles to the HTML so that the browser loads the styles before loading the JavaScript. // renderer/_default.page.server.jsx...
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