Nothavid
Nothavid
CC#
Created by Nothavid on 10/2/2024 in #help
Blazor Isolated CSS not working
I have a Blazor app in InteractiveAuto mode and isolated css stopped working. I am not sure when it stopped working or what I changed. The attributes of the affected html elements are generated correctly. The generated css file contains the following:
@import 'ChemStore.Web.Client.bundle.scp.css';
@import 'ChemStore.Web.Client.bundle.scp.css';
I don't believe that the isolated css file is relevant since I tried removing all css I added myself, but I will provide it anyway:
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

.header {
display: flex;
justify-content: space-between;
padding: 10px;
background-color: #f8f9fa; /* Light background for the header */
}

.profile-container {
position: relative;
}

.profile-icon {
width: 40px; /* Set icon size */
height: 40px;
border-radius: 50%; /* Circular icon */
cursor: pointer;
}

.profile-menu {
position: absolute;
top: 50px;
right: 0;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
padding: 10px;
width: 150px;
z-index: 1000;
}

.profile-menu ul {
list-style-type: none;
padding: 0;
margin: 0;
}

.profile-menu ul li {
padding: 10px 0;
}

.profile-menu ul li a {
text-decoration: none;
color: #333;
display: block;
padding: 5px;
}

.profile-menu ul li a:hover {
background-color: #f1f1f1;
}

.home-icon {
position: relative;
width: 40px; /* Set icon size */
height: 40px;
cursor: pointer;
}
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}

#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

.header {
display: flex;
justify-content: space-between;
padding: 10px;
background-color: #f8f9fa; /* Light background for the header */
}

.profile-container {
position: relative;
}

.profile-icon {
width: 40px; /* Set icon size */
height: 40px;
border-radius: 50%; /* Circular icon */
cursor: pointer;
}

.profile-menu {
position: absolute;
top: 50px;
right: 0;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 5px;
padding: 10px;
width: 150px;
z-index: 1000;
}

.profile-menu ul {
list-style-type: none;
padding: 0;
margin: 0;
}

.profile-menu ul li {
padding: 10px 0;
}

.profile-menu ul li a {
text-decoration: none;
color: #333;
display: block;
padding: 5px;
}

.profile-menu ul li a:hover {
background-color: #f1f1f1;
}

.home-icon {
position: relative;
width: 40px; /* Set icon size */
height: 40px;
cursor: pointer;
}
8 replies
CC#
Created by Nothavid on 8/14/2024 in #help
Discord.NET cannot view invite uses
No description
4 replies
CC#
Created by Nothavid on 5/19/2024 in #help
✅ Finding all FieldInfo's of BackingFields of a type
I have following code snippet to find all FieldInfo's of a type t which are BackingFields of public properties of type double.
FieldInfo[] doubleFields = t
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Where(p => p.PropertyType == typeof(double))
.Select(p => t.GetField($"<{p.Name}>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance)!)
.Where(f => f is not null)
.ToArray();
FieldInfo[] doubleFields = t
.GetProperties(BindingFlags.Public | BindingFlags.Instance)
.Where(p => p.PropertyType == typeof(double))
.Select(p => t.GetField($"<{p.Name}>k__BackingField", BindingFlags.NonPublic | BindingFlags.Instance)!)
.Where(f => f is not null)
.ToArray();
I was now wondering if the CompilerGeneratedAttribute is only applied to BackingFields or if there are other instances of fields having that attribute since I cannot currently think of any. If it is only applied to BackingFields, I could skip the step of getting all properties.
4 replies