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

Support for gradient presets #14

Closed
3 tasks done
Levdbas opened this issue Feb 2, 2021 · 4 comments
Closed
3 tasks done

Support for gradient presets #14

Levdbas opened this issue Feb 2, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Levdbas
Copy link

Levdbas commented Feb 2, 2021

Summary

Add the ability to fill the editor-gradient-presets in similar way as the color palette via this plugin.

Motivation

Having to manage your brand colors in once place instead of 2 is great! I use it every single day in my new gutenberg era way of work. As there is now gradient support in a very easy way in custom blocks I would love to see this supported by the pallete-webpack-plugin.

Additional context

Gradient presets also have three parts to be filled.

add_theme_support(
      'editor-gradient-presets',
      [
         [
            'name'     => Red to transparent,
            'gradient' => 'linear-gradient(180deg,#263e45 0,rgba(38,62,69,.8) 10%,rgba(38,62,69,0)',
            'slug'     => 'red-to-transparent',
         ],
      ]
   );

So i think the output function almost can be the same but then outputs to a gradients.json? I'd love to hear what you think.

@Log1x
Copy link
Sponsor Member

Log1x commented Feb 2, 2021

I'm definitely for this idea and have thought about it.

I mainly just don't know how we'd process this properly, specifically in Tailwind. What the user puts in the config doesn't give us much to play with gradient-wise given all the properties are set with CSS Vars.

After that comes SASS Maps which we still need to figure out a way to ditch sass-export so we can get rid of this plugin annoyingly bringing in node-sass.

I'm open to brainstorming for sure, but right now I'm not sure if there's a steady approach.

@Log1x Log1x added enhancement New feature or request help wanted Extra attention is needed labels Feb 2, 2021
@Levdbas
Copy link
Author

Levdbas commented Feb 2, 2021

I looked into the tailwind docs and I cannot find a smart way to incorporate this. Regarding sass-export. I am hoping that my PR plentycode/sass-export#63 to at least update all the dependencies gets accepted. I even have a commit ready that ditches node-sass for dart sass. So hopefully at some point this gives us one less thing to worry about.

@Levdbas
Copy link
Author

Levdbas commented Feb 24, 2021

Stage one of my effort to get sass-export updated is completed. They just released an updated version with all the dependencies bumped: https://github.com/plentycode/sass-export/releases/tag/1.0.7

I just made a new PR for ditching node-sass in favor of dart sass. So hopefully I can get the momentum going over there. plentycode/sass-export#64

@Levdbas
Copy link
Author

Levdbas commented Apr 7, 2021

V2 of sass-export is out now with dart-sass instead of node-sass: https://github.com/plentycode/sass-export/releases/tag/2.0.0

@Levdbas Levdbas closed this as completed Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants