question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Conditional css class property

See original GitHub issue

I have seen a lot of class bindings adding css class if condition is true, like: {value: IsActive ? "active" : ""}. I think we could implement some nicer way to code this behavior, something similar to knockout css binding.

Maybe it could be attribute group, like RouteLink Param-…

<div CssClass-active="{value: IsActive}">
    ...

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
Sejselcommented, Sep 26, 2016

Implemented

Example:

<div Class-italic="{value: Italic}" Class-blue="{value: Blue}" Class-bordered="{value: Bordered}">
        DotVVM is awesome!
</div>
0reactions
darilekcommented, Jun 19, 2016

@exyi nice feature, i agree with simplified naming

Read more comments on GitHub >

github_iconTop Results From Across the Web

CSS | Conditional Rules
CSS Conditional Rules are nothing but a feature of CSS in which the CSS style is applied based on a specific condition.
Read more >
How to conditionally apply a CSS class? [duplicate]
Variables in CSS should be declared within a CSS selector that defines its scope. For a global scope you can use either the...
Read more >
Conditional CSS
In simple words, it's about design that has certain conditions. When one or more conditions are met, the design is subject to change...
Read more >
Logic Hop Conditional CSS
Logic Hop's Conditional Not logic allows you to display content when a condition is not met. Conditional Not CSS works exactly the same...
Read more >
CSS conditional rules - CSS: Cascading Style Sheets | MDN
The CSS conditional rules module lets you define a set of rules that will only apply based on the capabilities of the processor...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found