Add conditional properties to Stencil via modifiers and values #2941
                  
                    
                      NicholasBoll
                    
                  
                
                  started this conversation in
                General
              
            Replies: 0 comments
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
        
    
Uh oh!
There was an error while loading. Please reload this page.
-
We combined modifiers and variables to provide flexibility in Stencils to support hard-coded modifier values as well as dynamic input:
But there's a problem. What if you do not want to define
paddingif not provided to the Stencil. According to the CSS custom property specification, thevar()will always return a value. This means thepaddingproperty is always defined, even if the value is invalid. If thevar(--padding)is not defined, it will returnunset. Ifpaddingwas defined elsewhere (maybe we're extending a Stencil), we've overridden the padding!What if we could define a fall through so that we don't need to define
paddingin thebasestyles?Now if
paddingis not provided to the Stencil, thepaddingstyle property will not be defined and will not override any other styles that already definepaddingBeta Was this translation helpful? Give feedback.
All reactions