Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen is distorted onload for few seconds and then loads properly #3050

Open
SowjanyaKrishnamurthy opened this issue Nov 6, 2024 · 3 comments

Comments

@SowjanyaKrishnamurthy
Copy link

Hi Team,

I see the screen is distorted for 3-5seconds on load which looks ugly for the user when they are using application. The styling of all buttons are not rendered until the content is initialized. Could you please provide solution for this.

I have attached the screenshot for the same.Image
Image

Thanks in advance!!

@Akshat55
Copy link
Contributor

Akshat55 commented Nov 8, 2024

Hmmm if I remember correctly, this is caused by user not setting theme in root of the project.

@use "@carbon/styles/scss/config" with (
	// Use flexbox for grid - stick to CSS Grid or Flexbox
	// CSS Grid has become the default grid system in v11
	$use-flexbox-grid: true
);

@use "@carbon/styles";

html {
	@include styles.theme(styles.$white);
}

@SowjanyaKrishnamurthy
Copy link
Author

Hi @Akshat55,

Here is my styles.scss file where I have configured mentioned settings on carbon

**@use "@carbon/styles/scss/config" with ( // Use flexbox for grid - stick to CSS Grid or Flexbox
// CSS Grid has become the default grid system in v11
$use-flexbox-grid: true);

@use "@carbon/styles";
@use "@carbon/styles/scss/type";
@import '../node_modules/@carbon/type/scss/styles';
@import '../node_modules/@carbon/styles/scss/type/index';
@import './carbon-styles.scss';

html {
@include styles.theme(styles.$white);
}**

Even after this, the screen looks same as in screenshot. Could you please help me if I am missing anything .

@Akshat55
Copy link
Contributor

@import '../node_modules/@carbon/type/scss/styles';
@import '../node_modules/@carbon/styles/scss/type/index';

Can be changed too:

@use '@carbon/styles/scss/type';

I'm not really sure, I can't really debug this without replicating this.

I suggest you try updating to latest @carbon/styles and CCA versions. I recommend you look into our carbon-angular-starter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants