How can I rewrite the following line into a multi-line form in stylus?

div
  box-shadow 0 0 0 black, 1 0 0, black, 0 0 1, black

Using a much larger list of properties for box-shadow will make my editor explode. I want sth like this, but Stylus syntax will not allow it:

div
  box-shadow
    0 0 0 black,
    1 0 0 black,
    0 0 1 black

Also omitting the commas is not working. This is frustrating...

有帮助吗?

解决方案

I believe i have seen the coding set up like this:

div
  box-shadow:
    0 0 0 black,
    1 0 0 black,
    0 0 1 black

or try this if the one above does not work

div
  box-shadow: 0 0 0 black,
              1 0 0 black,
              0 0 1 black

I Hope This Helps You.


Also works in the context of media queries. (real world example for retina-enabled sprites). Note the (somewhat odd-looking) indentation of the second background-image.

.sprite
  background-image url('/assets/static/sprite.png')
  background-repeat no-repeat
  background-size 960px 480px;

  @media only screen and (-webkit-min-device-pixel-ratio 1.3),
    only screen and (-o-min-device-pixel-ratio 13/10),
    only screen and (min--moz-device-pixel-ratio 1.3),
    only screen and (min-device-pixel-ratio 1.3),
    only screen and (min-resolution 120dpi)
    background-image url('/assets/static/sprite_x2.png')

其他提示

I wrote like this.

div
  box-shadow \
    0 0 0 black \
    1 0 0 black \
    0 0 1 black
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top