Angular Universal: Pre rendered HTML page appears initially broken - angular-universal

am pre rendering my pages via angular universal and it's all working fine. Except that when the page is initially loaded, it appears all broken for a couple of seconds before the styles are loaded.
On checking the page source, i could see multiple <style ng-transition> tags in the <head> which i assume is added by the pre rendering engine. Am not sure why it does not appear properly. Any leads?
Could not find any documentation in angular for the above mentioned style tags or could not find any resources online.
Thanks

Related

Rails does not load the html structure

I'll love if you can help me with a problem.
I'm developing a task app (just to practice) and I started with the styles using SASS.
Just to validate that the SASS is running I added a body background color, but this style does not applying for all views.
When I saw the console to see the html structure, I noticed that some views doesn't have the html structure from the application.html.erb, just the html that I have in that file.
NOTE: I have the style applied in a main.scss file, where all the files should have the style.
This is the root route
This is another view, where the style is applied
EDIT: I found the next message when inspect the element, but I don't know why is this happening

Loading Styles With Webpack causes styles to blink on initial load

I'm currently working on a project and Im attempting to load my scss/sass through webpack. I'm currently loading it in successfully using the following libs:
node-sass
sass-loader
css loader
style-loader
I am able to require/import the styles in successfully but the problem occurs that when I load up the application the page loads without the styles for about 1.5 seconds and then after the page "blinks" and the styles finally load in.
Is there a way to get around this through webpack? I have heard of ExtractTextPlugin and a few others but I've tried to implement it by looking at article examples and github examples but they don't seem to work by using require/import where they are needed. I'd like to only require the styles based on my react component needs. Not loading any styles that the components don't need.
You have (at least) two options to prevent this FOUC (Flash of unstyled content):
Use a plugin like mini-css-extract-plugin or extract-text-webpack-plugin to extract the compiled CSS into a separate file that you can load normally in your <head> (read more) or
Hide your content, using CSS, until styles are ready, the loaded styles should contain the styles that will make the content visible.

How to check why there is a lag loading the stylesheet for website

I'm building a website and there seems to be a lag with loading the stylesheets. It seems as if the page loads without the stylesheet and then a few seconds later (depending on the network speed) the entire page loads. This would of course be a bad experience for the users. I can't figure out what stylesheet is not loading quickly to cause this delay. Here are the links.
http://www.hotelzoo.com/sign_up?hotelregister=true
http://www.hotelzoo.com/sign_in
I'm coding this using Ruby, Heroku, and AWS if that helps.
You're importing the CSS in the bottom of the page, together with the JavaScript but it shouldn't be there. Always import the CSS inside the <header> tag at beginning, this way the browser will load the source files before rendering the page.

Slickgrid pager within Dynamics CRM having one icon per line

I am developing an application which runs within Microsoft Dynamics CRM (MSCRM). Essentially in this environment web resources including HTML, JavaScript, CSS and image files are stored within the system the can be referenced on pages. I've got SlickGrid running but have an issue where the pager buttons each occupy a whole line. The key part of the HTML is:
<div id="SPLocation" style="width:100%; height:80%">Grid</div>
<DIV id="SPPager" style="width:100%;height:20px;">Pager</DIV
but it looks like this:
!http://www.clew-consulting.com/Temp/SGIssue.png
(hope this image works). Note each icon occupies a whole row. I've checked all the styles and images and they seem fine. The icons are functional.
The cause is probably that display:inline-block is not being picked up but it is there in the style sheets. It could be something special to do with the environment within MSCRM but the other markups all look fine.
Unfortunately I cannot run IE developer and show this part of the screen where I could inspect the CSS.
Anyone any ideas? I know I have not posted all information.
Paul
The pager styles are defined in slick.pager.css file.
Place this file in your css folder and add the following line to your html file
(do not forget to replace [path to your file] with your real path):
<link href="[path to your file]/slick.pager.css" rel="stylesheet">

ie8 hangs when opening a site which uses css3

I just completed a site: http://www.justcelebrations.co.in . I haven't launched it yet because of certain problems. The site uses css3 text gradients to style text in span and border radius to style most divs. It has to be made dynamic later so I don't want to change the text effects to images or something. The problem I am facing is that the site hangs IE8. I haven't tested it in lower versions of IE. I have tested the markup thoroughly and its validated and the css too is valid except for features which are from css3 like opacity, border-radius etc. I have also added google script to make ie behave properly and mordenizer library. The site still hangs IE8. Please Help me out here..
EDIT: after a lot of testing and debugging, found out that ie<9 were crashing because of some text elements being styled by p:first-letter or h1:first-letter (which, as is the case with ie, is totally random as :first-letter is supported by IE7+ ). So all i did was separated those styles from base.css to a non-ie.css and loaded that file with a [if ! lt IE 9]
and it worked!
after a lot of testing and debugging, found out that ie<9 were crashing because of some text elements being styled by p:first-letter or h1:first-letter (which, as is the case with ie, is totally random as :first-letter is supported by IE7+ ). So all i did was separated those styles from base.css to a non-ie.css and loaded that file with a [if ! lt IE 9] and it worked!
Can you add <!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]--> to target fixes. As you make changes view in IE8 through IE9(F12) and play with -ie-(compared to -moz- & -o-) in your css. I would also keep a CSS 2.1 file and a CSS3 file to keep track of your new code.
It's working good here in Safari. Just to narrow this down, what if you remove all the conditional and IE specific libraries you got from Google? In my experience, all the various JS libraries that are supposed to make older IE versions behave always seem to break or conflict with some other script or library like jQuery.
Also see the answer in this thread for optimizing your page loading by placing the JavaScripts at the end of the <body> section. Perhaps in your case, loading the JS last will make some kind of difference to Explorer.

Resources