Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Daniel Shuy

    Hi all, I have a noob question:
    If a variable is defined with multiple parameters, eg.

    $padding = 4px 10px

    How can I get the 1st parameter of the variable (in this case 4px)?

    Daniel Shuy
    @qm3ster wow thanks! Stylus ftw
    Anybody here used stylus with electron-compile
    target: 'electron-renderer',
    How can I use the embedurl ?? It's return the current url of the file instead of base64
    how can I change the hue and increase the saturation of a hex color value?
    kevin olson
                  throw err;
    ParseError: unexpected ","
        at Parser.error (/Users/k/.config/yarn/global/node_modules/stylus/lib/parser.js:259:11)
        at Parser.stmt (/Users/k/.config/yarn/global/node_modules/stylus/lib/parser.js:819:32)
        at Parser.statement (/Users/k/.config/yarn/global/node_modules/stylus/lib/parser.js:685:21)
        at Parser.parse (/Users/k/.config/yarn/global/node_modules/stylus/lib/parser.js:236:25)
        at Renderer.render (/Users/k/.config/yarn/global/node_modules/stylus/lib/renderer.js:80:22)
        at /Users/k/.config/yarn/global/node_modules/stylus/bin/stylus:655:15
        at tryToString (fs.js:512:3)
        at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:500:12)
    i dont understrand how im supposed to figure out whats wrong here
    so annoying sometimes how cryptic stylus errors are
    kevin olson
    last message september 19th dang
    Colton Colcleasure
    Really wish there was a bigger Stylus community. It is hard to suggest when there is no news about it, articles, or anything. -_-
    @acidjazz unexpected ","
    Mihail Malo
    @colshacol There's Vuetify
    @acidjazz Consider the following: A stylus linter
    Not only will you be able to choose one style out of stylus' astronomical number of ways of writing the exact same thing, the parse errors will be right in your editor and not at runtime

    @colshacol > Really wish there was a bigger Stylus community. It is hard to suggest when there is no news about it, articles, or anything. -_-

    Maybe now's the time to show the world your Stylus fan-fic?

    I have been trying to find good comparisons of sass/scss and stylus, can anyone tell me the gamechanger of stylus since I am unable to make out large differences :(
    I all seems to be the same except for a bit of syntax
    Or putting it a bit different. Is there any major benefit in migrating from sass/scss to stylus other than personal preference?
    kevin olson
    @qm3ster which linter do you use?
    Gavin McFarland
    Hi @bm-stschneider the biggest difference for me was ability to use transparent mixin. Seems trivial but I like being able to create custom CSS properties/declarations.
    kevin olson
      flex 0 0 calc( 33% - unit($gap, px) )
    this gives me an error
    Mihail Malo

    @acidjazz I suspect you might be looking for

    $gap = 3
      display flex 0 0 s('calc( 33% - unit(%s, px))',$gap)

    which produces

    .himstdve {
      display: flex 0 0 calc( 33% - unit(3, px));
    kevin olson
    thanks ill give it a shot
    Mihail Malo
    were you sitting here all along
    kevin olson
    12 days
    Mihail Malo
    Since the unit is static I actually recommend
    $gap = 3
      display flex 0 0 s('calc( 33% - %spx)',$gap)
    Reminds me of my younger days when I made this function:
    interpolate(value_small, value_large, breakpoint_small, breakpoint_large)
      u = unit
      output_unit = u(value_small)
      unless output_unit == u(value_large) and output_unit == u(breakpoint_small) and output_unit == u(breakpoint_large)
        error('Different units')
      v_s = u(value_small, '')
      v_l = u(value_large, '')
      b_s = u(breakpoint_small, '')
      b_l = u(breakpoint_large, '')
      num_vw = 100 * (v_l - v_s) / (b_l - b_s)
      num_const = v_s + b_s * (v_s - v_l) / (b_l - b_s)
      return 'calc(%s + %s)' % (u(num_vw, vw) u(num_const, output_unit))
    Mihail Malo
    @acidjazz peep the second version so your output files aren't doing unit for no reason.

    You could use stylus' unit function, but there's no reason that I know of:

    $gap = 0
      display flex 0 0 s('calc(33% - %s)', unit($gap, px))

    For example, with a gap size of 0 i still outputs a filthy calc(33% - 0px) instead of calc(33% - 0).
    Imagine automatically outputting calc(33%) or 33%!!!
    Maybe with PostCSS

    kevin olson
    hmm cool
    Is this the main stylus chat? is there a discord or a slack I don’t know about? why’s it so dead I wonder
    also we havent had a release in 2+ years now, yet i see all these PR’s go in of cool features/etc
    Mihail Malo
    @acidjazz Ur always here. Fork it, merge pull requests, start a discord :v:
    kevin olson
    @qm3ster as soon as I get time :)
    kevin olson
    i have a linear-gradient
    background-image linear-gradient(-45deg, fountain-blue 25%, transparent 25%, transparent 50%, fountain-blue 50%, fountain-blue 75%, transparent 75%, transparent )
    is there any way i can indent some of this ins stylus?
    Gideon Kreitzer
    @lazytyper have a look at Platframe for a Stylus-based UI framework
    kevin olson
    it looks like that in css now, ! and ? are a thing
    immediate previous and general previous siblings
    and stylus def breaks when im try to rock that
    any workaround i wonder?
    kevin olson
    has anyone here gotten stylus setup with tailwind?
    kevin olson
    so it looks like our main issue is not support @apply and @nested