N
N
NakedSnake272021-11-23 15:18:26
css
NakedSnake27, 2021-11-23 15:18:26

Can I create external styles outside Blazor's CSS isolation?

I have a site with separated styles, it looks like this: JRXAX.png

In Style I import all the blocks in the HTML markup

@import "Core.css"
@import "Header/Header.css"
@import "Main/Main.css"
@import "Footer/Footer.css"
@import "И тому подобное"


Then I migrated my site to Blazor WebAssembly and applied the same block splitting method. ZTJV9.png
It just happened that all the styles are in a static folder, and there are imports in the isolation of MainLayout.styl.
And if you include styles in a static index, then imports in isolation will not be needed.

And here I have a few questions:
  1. Is it possible to do this and does it follow the Blazor Style Guide?
  2. If you can't do that, what's the best way to do it?
  3. If so, how can this method be improved?
  4. If I use MainLayout.styl which will emit CSS, would that be better than all of the above options?


Thanks for the answer!

PS I didn't get an answer on StackOverflow, but I'll leave a link to the original ( https://stackoverflow.com/q/70070506/16943903 ).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NakedSnake27, 2021-11-27
@NakedSnake27

Since no one has given an answer, I will answer my own question.
The answer is in my post here: https://stackoverflow.com/q/70070506/16943903 .
(I leave the text in case the question is deleted)
Well, no one answered, so I will write my answer to my question.
I split MainLayout into two parts - HeaderLayout and FooterLayout, made CSS isolation and in MainLayout I put them together.
687iF.png
u99SF.png
And use pseudo-class ::deep for child component support (source: https://docs.microsoft.com/en-us/aspnet/core/blazo... ).
I think my solution correspond to the Blazor Style Guide and in general it is quite effective.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question