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

alternative for shadows props without dependency on media props (e.g. custom media queries / PostCSS) #533

Closed
thescientist13 opened this issue Dec 15, 2024 · 2 comments

Comments

@thescientist13
Copy link

I noticed that the file for shadows props depends on the media props file. However, the website states that these media props can only be used with a PostCSS plugin.
https://open-props.style/#media-queries
Screenshot 2024-12-14 at 7 50 57 PM

For those of not using PostCSS is there a way to get the shadow styles without also pulling in those media styles? I'm currently just trying to opt-in one prop file at a time.

/* src/styles/theme.css */
@import "../../node_modules/open-props/src/props.borders.css";
@import "../../node_modules/open-props/src/props.fonts.css";
@import "../../node_modules/open-props/src/props.shadows.css";
@import "../../node_modules/open-props/src/props.sizes.css";

Thanks in advance!

@thescientist13 thescientist13 changed the title alternative for shadow styles without dependency on media styles (e.g. custom media queries) alternative for shadows props without dependency on media props (e.g. custom media queries) Dec 15, 2024
@thescientist13 thescientist13 changed the title alternative for shadows props without dependency on media props (e.g. custom media queries) alternative for shadows props without dependency on media props (e.g. custom media queries / PostCSS) Dec 15, 2024
@argyleink
Copy link
Owner

hi!

looks like youre using the PostCSS files in your import: @import "../../node_modules/open-props/src/props.shadows.css";. this path you shared is specifically to the PostCSS file, which as an author would mean you're going to run PostCSS on them.

if you're not using PostCSS, you can import the files that have already been processed by PostCSS (which are the default exports). instead use @import "open-props/shadows"; or @import "../../node_modules/open-props/shadows.min.css"; as these import paths grab the processed files.

tldr; you can totally use the shadows without PostCSS, you just need to import a different shadows file: https://unpkg.com/browse/open-props@1.7.8/shadows.min.css

@thescientist13
Copy link
Author

Ah, excellent! Thank you so much for the explanation and the pointer in the right direction, everything is working great now 💯

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