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

SCSS support #22

Open
osterbaer opened this issue Apr 11, 2023 · 1 comment
Open

SCSS support #22

osterbaer opened this issue Apr 11, 2023 · 1 comment

Comments

@osterbaer
Copy link

osterbaer commented Apr 11, 2023

Hello,

in my current project, we would like to use the Phosphor Icons library. Still we don't want to use the CSS classes directly but integrate the icons into our existing classes. For that it would be awesome to have SCSS variables for the unicode characters used by the different icons. Is something like that planned for the near future? Currently, we're using a script extracting the necessary data out of the stylesheet file, but it would be way better to reference the library directly.

Thanks in advance!

@rektdeckard
Copy link
Member

I'm not super versed in SCSS beyond the base case of variables, but can you explain your use case and why it makes sense over just using the lib classes?

Since our implementation uses pseudoelements and multiple classes and properties, you would need to be careful about how you applied them. content: $ph-smiley; would probably work fine for regular weight, but how would you approach the duotone icons, which are implemented with a :before AND an :after pseudoelement, with specific opacity and margin respectively? How would WE recommend they be used?

Consider this case:

.ph-duotone.ph-address-book:before {
  content: "\e900";
  opacity: 0.2;
}
.ph-duotone.ph-address-book:after {
  content: "\e901";
  margin-left: -1em;
}

What is idiomatic SCSS would you write for this? What markup?

Happy to include it if you contribute a solution that makes sense and is codegen-able, but it's not something I am planning for the moment.

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

2 participants