Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postcss-easy-import #145

Closed
TrySound opened this issue Jan 9, 2016 · 22 comments
Closed

postcss-easy-import #145

TrySound opened this issue Jan 9, 2016 · 22 comments

Comments

@TrySound
Copy link
Member

TrySound commented Jan 9, 2016

postcss-easy-import

What if we will create pack around postcss-import with many optional things like prefix, extensions, glob etc.

How it could be named?

Options:

prefix

Type: String
Default: _

Add before imported filename.

@import "dir/partial" will look for dir/_partial.css with prefix: '_'

extensions

Type: Array or String
Default: .css

glob

Type: Boolean
Default: false

@ben-eb
Copy link
Member

ben-eb commented Jan 9, 2016

postcss-import-partial
postcss-import-glob
postcss-import-extensions

?

Idea is solid. 👍

@TrySound
Copy link
Member Author

TrySound commented Jan 9, 2016

@ben-eb No, no. I mean plugin with a few new options which will be wrap postcss-import

postcssPackImport({
  partial: false,
  extensions: ['.css'],
  glob: true
})

@MoOx
Copy link
Contributor

MoOx commented Jan 9, 2016

Sounds weird and will create confusion imo.

@TrySound
Copy link
Member Author

TrySound commented Jan 9, 2016

@MoOx postcss-import can be strict and spec followed but with extending ability. postcss-pack-import (or another name) will use postcss-import as a dependency and realise scss-like features without any complications. Just for lazy people.

@TrySound
Copy link
Member Author

TrySound commented Jan 9, 2016

Modularity celebration :)

@MoOx
Copy link
Contributor

MoOx commented Jan 9, 2016

I get your point, but most people are lazy.
Find a good name first, then we will talk :D.
Kidding.
What about postcss-easy-import ?

@TrySound
Copy link
Member Author

TrySound commented Jan 9, 2016

Make sense.

/cc @jonathantneal

@TrySound
Copy link
Member Author

@MoOx
Copy link
Contributor

MoOx commented Jan 29, 2016

Nice, can you make a PR to README and add a comment/link in 8.0 CHANGELOG section so we can close this issue?
Thanks a ton!

@jonathantneal
Copy link
Member

First, great work @TrySound! So, this is a wrapper to give postcss-import the functionality of postcss-partial-import? Honest question, if we could just refactor postcss-import, would the functionality belong in a separate plugin? PostCSS partial import was only created for PreCSS compatibility. I did not like the idea of (and I accept all the flack for) creating a separate plugin for nearly the same functionality.

@TrySound
Copy link
Member Author

postcss-import is simple and powerful api with "all we need" defaults. easy-import just gives extra very specific functionality. Powerful of modularity :)

@jonathantneal
Copy link
Member

Why should this sugar be in its own repo? I don’t like there being 3 repos now.

For instance, postcss-import does sluething to resolve the path of an @import rule. It will look in process.cwd(), web_modules, node_modules and local modules, right? Is that not sugar? Is it part of a spec?

@TrySound
Copy link
Member Author

@jonathantneal You are right. But it's simple resolver and common usable stuff. And easy-import includes all postcss-import features like media queries and plugins option for linting

@TrySound
Copy link
Member Author

TrySound commented Mar 2, 2016

@jonathantneal postcss-import and postcss-partial-import are not competitors. Your module is inliner syntax "sugar". It can inline files inside rules or at-rules. But you can't realize spec media resolver. I did it in postcss-import. It has constraints. But it works like bundler. postcss-easy-import is just spec + some resolve help for sass lovers.

@MoOx
Copy link
Contributor

MoOx commented Apr 22, 2016

This thing is done, so closing.

@MoOx MoOx closed this as completed Apr 22, 2016
@simonsmith
Copy link
Contributor

Could we consider bringing some of this functionality back in? easy-import has been abandoned from what I can see and useful changes like this one have been left unmerged.

I think globbing is a very useful and popular addition.

cc @RyanZim

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 29, 2016

@simonsmith First, this won't happen in v9.0.0; it's long overdue for release. Hope that gets out in the next few days.

Second, this is highly bikeshedable. Perhaps you can open a new issue outlining some of your thoughts; when consensus is reached, we can proceed to implement.

@TrySound
Copy link
Member Author

Who want to get access to this?

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 30, 2016

@TrySound I hardly have time; @simonsmith, you feel like trying?

@simonsmith
Copy link
Contributor

If @TrySound is happy to let others contribute to postcss-easy-import then maybe we can just continue the work on that repo.

I'd be happy to help merge the outstanding PR and have a look at the remaining issues.

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 30, 2016

@simonsmith Go for it!

@simonsmith
Copy link
Contributor

For reference just published 2.0.0 which fixed all outstanding issues and uses latest postcss-import - https://github.com/TrySound/postcss-easy-import/releases/tag/2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants