custom css not working
See original GitHub issueHello,
It seems that custom css in the nodetemplate is not being applied.
Minimal example:
FunctionNodeWidget.razor
<div class="default-node functionnode @(Node.Group != null ? "grouped" : "") @(Node.Selected ? "selected" : "")" style="width: 250px; background-color: @Node.Function.Color">
@Node.Function.Name
@foreach (var port in Node.Ports.Cast<FunctionPortModel>())
{
<PortRenderer Port="port" Class="functionport">@port.Connector.Name</PortRenderer>
}
</div>
@code {
[Parameter]
public FunctionNode Node { get; set; }
}
As you can see I’m adding class functionport on the PortRenderer. It is defined in the component’s stylesheet:
FunctionNodeWidget.razor.css
.functionport {
padding: 5px;
margin: -18px;
border-radius: 50%;
background-color: #f5f5f5;
border: 1px solid #d4d4d4;
cursor: pointer;
position: absolute;
}
It does not get applied at runtime. Moving the class to app.css doesn’t work either. Am I doing something wrong?
Thank you
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Why my Custom CSS doesn't work? - WordPress Websites ...
Here are the most common mistakes causing the custom CSS doesn't work: · Inspect the element! First of all, make sure you have...
Read more >Why Your Custom CSS Doesn't Work in WordPress and How ...
Fortunately, it's fairly easy to find and diagnose the problem. Go to any page on your site and, in Chrome, right-click and select...
Read more >Customizing Additional CSS not working
I'm adding additional CSS in the regular WP customizer, but it does not effect the page on the right. But, if I Publish...
Read more >My Custom CSS Isn't Working
Why the custom CSS code is not getting applied · 1. Syntax Errors. Reason: CSS code has syntax errors. Fix: Make sure that...
Read more >Custom CSS class not working
Try the key-combination CTRL (CMD on mac) + SHIFT + R, or CTRL + F5 for IE. This will clear your local cache...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After some fumbling around it seems !important is doing the trick. I guess I’m just having some sort of precedence-issue, and there is no issue with your library. I think we can close.
Thanks for your work and this utility
So technically, the CSS is working. If you inspect your node’s ports, they aren’t styled at all? Maybe it’s just not visible (since it’s only 5px padding)? What if you put your css (without the deep thing) on a global css file (no CSS isolation) and see if that works?