-
-
Notifications
You must be signed in to change notification settings - Fork 81
Refactor of Scoped CSS #413
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
base: master
Are you sure you want to change the base?
Conversation
width: 125px; | ||
} | ||
|
||
img { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be "dangerous" as it now targets every "img" whereas it was scoped to the component before. so probably you want something like actions-img or so?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood, gonna check that issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the bUnit tests are red, as you "renamed" the CSS selectors
So I rename it back to the original or update the bUnit tests? |
I would do the latter |
Removed the empty razor css files and added one that I missed. An issue that remains is at home, the introduction hasn't show up yet of |
Hmm that might be because of |
There are some smaller tests that refer to the "old" structure: var items = cut.FindAll(".profile-keypoints li"); |
Based on dev tools the profiles images are loaded correctly but don't show up on the page How it works: Another bug is with PreviewImageRazor for blogposts that takes over the entire space and locks The css is @if (string.IsNullOrEmpty(PreviewImageUrlFallback))
{
<img src="@PreviewImageUrl" alt="Preview image blogpost" loading="@LazyLoadTag" decoding="@DecodingTag" />
}
else
{
<picture>
<source srcset="@PreviewImageUrl" type="@GetMimeType()"/>
<img src="@PreviewImageUrlFallback" alt="Preview image blogpost" loading="@LazyLoadTag" decoding="@DecodingTag" />
</picture>
} |
Do you need me to update them and search for other CSS renames too? |
About this portion of the issue with PreviewImage.razor I did progress adding .img-container {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.comp-img {
position: absolute;
top: 0;
left: 0;
object-fit: cover;
height: 100%;
width: 100%;
} For <div class="img-container">
<img class="comp-img" src="@PreviewImageUrl" alt="Preview image blogpost" loading="@LazyLoadTag" decoding="@DecodingTag" />
</div> For <div class="img-container">
<picture>
<source srcset="@PreviewImageUrl" type="@GetMimeType()" />
<img class="comp-img" src="@PreviewImageUrlFallback" alt="Preview image blogpost" loading="@LazyLoadTag" decoding="@DecodingTag" />
</picture>
</div> but for some reason now stopped working haha the PreviewImageUrl too |
We have to make the tests work in one way or another. In this regard, the selector has to be aligned to the new "prefix" added. |
I have to checkout the branch later locally. I tried inside GitHub Codespaces and I got some 404 for the images. Not sure if this is because of GitHub Codespace or it showcases the underlying issue on why the images aren't showing up. |
@EliasMasche I took the opportunity to push to your PR. Hope you don't mind. |
Yeah, no problem. the only issue that remains is the home/introduction CSS, right? |
Technically, yes. So of course everything should work as before, but overall I would like to go a step further, otherwise we just moved the CSS from one file to another. Ideally:
|
The navbar items seem a bit closer than they were before and lost their "bold" font. |
Should also be fixed. Now the interesting part starts: Consolidating :D |
Roger that. I checked your commits. I pulled into my local branch, and the CSS works now, but I am getting a 404 for the images.
The end goal is to put all CSS into
Good thing this time I put the PR as draft as it is more of a proposal and WIP. |
Interesting. By any chance, do you have a chrome based browser to cross-check if it happens there as well?
No worries - that is part of the process. Issues/PR's are async in nature and therefore are more likely to have misunderstandings and whatnot. |
Yeah, same issue coming from Edge Browser, What it dislikes is that it comes from the same application but a different domain or locally triggering CORS if I use it from another website/domain, or blob storage works fine. |
Hello there, sorry ( but may not be sorry) for the disappearance. I got relocated to a new team, a new project with an impossible deadline, so I wasn't able to work. So now I pushed a new commit, redoing the rename of a class of CSS as it wasn't necessary, I believed they had the same name, I put them all inside A question about the bootstrap, this sentence: Where can I find more information, or is it referring to the internal CSS classes of Bootstrap 5 |
Hey hey - don't worry. OSS has to make space for other priorities so I totally get that and there is no need to apologize.
Sometimes I added stuff like Or grid/flex layout can be solely described via Bootstrap's utility classes. There was often no need to create custom CSS. |
I started making some changes to Bootstrap. What is the plan? Besides, in this commit based on bootstrap, there are two ways to keep the custom class or use an inline. Checking through the repo, this is the only instance, so I guess using an inline CSS is fine And I am already triggering some fails in tests because the HTML classes are missing in the razor files. For the moment, I am working on replacing them with Bootstrap but keeping the custom classes in |
I am not sure if I understand correct? What do you mean by that?
If we keep stuff then still as classes. That is fine. If we see a chance to remove the custom CSS, that would be great, if not - then let's keep it as it is.
Why would we need them as fallback? Sure, the tests have to be adopted and that is unfortunately a bit of a shortcoming on the current test-setup that it uses too much the concrete CSS classes. But that is a whole different story :D so for now it might be the best, to change failing ones to the new classes to it still targets the same object. |
You replied this question in the second, I was asking or trying to ask if I should refactor until it is done or not possible to do it.
Sorry, what I mean is I still keep the old custom CSS classes for the time being for testing if the new HTML bootstrap CSS classes are working properly. Once I finish, I will do the cleaning. I am keeping a list of the custom CSS classes and commenting as I progress with the refactor |
I did some progress overall, trying to match or mimic the appearance from custom CSS classes with Bootstrap 5 and with that able to reduce LoS in There is this new warning:
About the tests, how is gonna be the progress going to be? |
Initial PR of the process for Scoped CSS