cssstylus

ternary operator and interpolation


This question is no longer valid!


Solution

  • You can use ternary operator and interpolation here:

    useShortNames = true
    selector = useShortNames ? '[class*="mobile-",class*="m-"]' : '[class*="mobile-"]'
    
    {selector}
      float: left
      padding-right: 20px