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

Add CSS Modules support #48

Merged
merged 3 commits into from
Sep 15, 2017
Merged

Add CSS Modules support #48

merged 3 commits into from
Sep 15, 2017

Conversation

Narazaka
Copy link
Contributor

@Narazaka Narazaka commented Sep 2, 2017

text {..green} -> <p css-module="green">text</p>

This feature can work with posthtml-css-modules then we can use CSS Modules enabled markdown.

@arve0
Copy link
Owner

arve0 commented Sep 13, 2017

Hi! Thanks for the contribution. CSS-modules are unknown to me, what is the use case? Is it a spec?

@Narazaka
Copy link
Contributor Author

Narazaka commented Sep 15, 2017

CSS-Modules are new css architecture.
cf. https://glenmaddern.com/articles/css-modules

CSS Modules mainly solves the problem of having difficult designing in the global namespace only in CSS, although not in JavaScript and other languages.
It is often used with high affinity with React, but it is useful not only for React but also for other componentizable templates.

I think it is common to use markdown as a component of a part of a Web site (the other part is React, jade, etc.). On this case, we would like to use CSS Modules inside of markdown as well as other parts already designed with CSS Modules.

It is conceivable to use the class attribute as it is as the CSS Modules attribute name, but it is often when you want to use fixed and global class names at the same time. For this reason, I thought it appropriate to provide the css-modules attribute for CSS Modules separately from the class attribute.

@arve0
Copy link
Owner

arve0 commented Sep 15, 2017 via email

@Narazaka
Copy link
Contributor Author

It is not a recommendation of W3C or CSSWG, but it is a specification based on scoped css which is an obsolete working draft.
css pseudo-class :scope https://developer.mozilla.org/ja/docs/Web/CSS/%3Ascope
css modules https://github.com/css-modules/css-modules

@arve0
Copy link
Owner

arve0 commented Sep 15, 2017

I think you misunderstood me, I ment the ..-notation. Is it common? I guess it makes sense, . being class.

@arve0 arve0 merged commit fdb30fb into arve0:master Sep 15, 2017
@arve0
Copy link
Owner

arve0 commented Sep 15, 2017

Released in v1.2.0

@Narazaka
Copy link
Contributor Author

Oops, sorry. ".." is not a standard form in particular, but I thought that it is an easier to understand way from the class ".".
Thank you.

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

Successfully merging this pull request may close these issues.

2 participants