News for hackers. Stuff that matters.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by tobr on Sunday May 22, 2016 @01:51PM (#11749521)
Looks like a great utility, but the output css isn't very compact. For example,

  ul li:nth-child(1) {
    background: red
  }

  ul li:nth-child(2) {
    background: red
  }

  ul li:nth-child(3) {
    background: red
  }
should just be

  ul li:nth-child(1),
  ul li:nth-child(2),
  ul li:nth-child(3) {
    background: red
  }
Also, it's not very clear how to download the family.scss file, it's buried deep in an oddly named subfolder in the repo.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by JelteF on Sunday May 22, 2016 @02:59PM (#11749783)
What would be even better is this:

    ul li:nth-child(-n + 3) {
        background: red;
    }
See the last example on this page: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Sunday May 22, 2016 @03:39PM (#11749928)
Wow, thanks for this one, updating now! :o

I assume that this is your github profile ? https://github.com/JelteF

Re:Show HN: Family.scss – a set of 20 smart SASS mixins by JelteF on Sunday May 22, 2016 @03:58PM (#11750008)
Yup
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by twolfson on Sunday May 22, 2016 @05:24PM (#11750347)
It might not be compact but the gzipped size is the same.

    $ cat <<EOF | gzip | wc -c
    ul li:nth-child(1) {
      background: red
    }

    ul li:nth-child(2) {
      background: red
    }

    ul li:nth-child(3) {
      background: red
    }
    EOF

    71 # bytes

    $ cat <<EOF | gzip | wc -c
    ul li:nth-child(1),
    ul li:nth-child(2),
    ul li:nth-child(3) {
      background: red
    }
    EOF

    71 # bytes
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Sunday May 22, 2016 @02:52PM (#11749743)
Hey @tobr, Thanks for your feedback, and you're right! I'll work on it for a next update.

For the download part, I think it's better to get the user to the folder where he can find the file in two different versions. But I take it in consideration and I'll try to improve that part.

Re:Show HN: Family.scss – a set of 20 smart SASS mixins by robinson7d on Sunday May 22, 2016 @02:25PM (#11749635)
Totally right. I made a PR to the repo showing a way to fix it: https://github.com/LukyVj/family.scss/pull/1
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by pedalpete on Sunday May 22, 2016 @07:16PM (#11750708)
I'm not sure who/why somebody would use this library when it is fairly easy to write these selectors using just CSS (for most use cases anyway).
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Monday May 23, 2016 @03:45AM (#11752468)
Hi,

There is no obligation to use it, if you think it's easy, then good for you :) You wont need it.

It's just here to make you save some time, to help you taming some wild targeting selectors. If you can do it, without some helpers, then just don't use it.

Re:Show HN: Family.scss – a set of 20 smart SASS mixins by atriix on Sunday May 22, 2016 @05:21PM (#11750336)
For anyone else searching, the actual file is https://github.com/LukyVj/family.scss/blob/master/source/src...
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by supernintendo on Sunday May 22, 2016 @01:45PM (#11749493)
Hey, great work. I don't have a personal use for this but for designers building a lot of static sites, it could be nice. I will say that you can achieve the same effect using classes with less bloat in your compiled CSS.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Sunday May 22, 2016 @02:57PM (#11749773)
Hey! Thanks for the nice words. Sure you could achieve the same effect with css classes, here I just present an other way to do it.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by wes-k on Sunday May 22, 2016 @07:39PM (#11750787)
Nice library!

Note: there's a small bug in the first example. Css output sets 'color' while the scss used 'background'.

Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Monday May 23, 2016 @07:49AM (#11753225)
Fixed! Thanks
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by angry-hacker on Sunday May 22, 2016 @05:21PM (#11750337)
The website is somehow able to hang and crash my Chrome browser on Android. Just thought I'll let you know.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Monday May 23, 2016 @07:50AM (#11753227)
Yeah, it can be really heavy for some systems. I'll work on that.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by Illniyar on Sunday May 22, 2016 @01:12PM (#11749354)
Looks nice, but I've never had the need for anything other then first/last and even/odd myself.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Sunday May 22, 2016 @02:55PM (#11749759)
Thanks,

Of course, you'll use this project ony if you have to deals with some more complex nth targeting on a regular basis.

Re:Show HN: Family.scss – a set of 20 smart SASS mixins by hobonumber1 on Sunday May 22, 2016 @01:16PM (#11749365)
Nice work! Great docs.
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by lukyvj on Sunday May 22, 2016 @02:57PM (#11749774)
Thanks :)
Re:Show HN: Family.scss – a set of 20 smart SASS mixins by restlessdesign on Sunday May 22, 2016 @03:06PM (#11749803)
Sass* :)