wentin / cssicon

icon set made with pure css code, no dependencies, "grab and go" icons
https://cssicon.space/
Creative Commons Zero v1.0 Universal
3.21k stars 178 forks source link

Create a singular file for each icon #6

Open krainboltgreene opened 8 years ago

krainboltgreene commented 8 years ago

I've noticed there's an "all" CSS file called icons.css, and each icon has a before and after and a "main" CSS, but no individual icon file with all the css for that icon?

wentin commented 8 years ago

it is separated in scss for each main and pseudo element to make the inspector work. it is put together with scss import in the main icon.scss file. Why do you need them in single files? You can click and "try it on codepen" there you have the css that is only for one icon. Does that address the problem?

krainboltgreene commented 8 years ago

Well if you start sharing the icons as asked in #5 it would be nice to import individual icons into a project:

require("node_modules/css-icons/css/print.css")
wentin commented 8 years ago

I see! right now I do @import 'icons/search/*'; in scss, would that work in your case? it just needs globbling

krainboltgreene commented 8 years ago

Not quite, since I actually use gulp for css compiling. See here:

gulp.task("styles", () => {
  return gulp.src([
  "./node_modules/font-awesome/css/font-awesome.css",
  "./node_modules/normalize.css/normalize.css",
  "./source/client/index.css"
])
    .pipe(gulpConcat("./transpiled/index.css"))
    .pipe(gulpMyth())
    .pipe(gulpSize({showFiles: true}))
    .pipe(gulp.dest(DESINATION))
    .pipe(gulpGzip({append: true}))
    .pipe(gulpSize({showFiles: true}))
    .pipe(gulp.dest(DESINATION))
})

gulp.task("watch", ["styles"], () => {
  gulp.watch(STYLES, ["styles"])
})

gulp.task("build", ["styles"])
wentin commented 8 years ago

after all icon get finalized, i can create those single css with some auto task runner :)