koustov / css-builder

CSS Builder is a unique application to learn, adapt, develop and test CSS snippets. It's being developed as a library which means anyone can consume it and provide form customization for their product in real time.
https://css-builder.vercel.app
MIT License
12 stars 8 forks source link

Allow CSS builder Whitelist and Blacklist tags #49

Open koustov opened 2 years ago

koustov commented 2 years ago

Is your feature request related to a problem? Please describe. How would wish to filter out some unrelated attributes when you consume CSS builder as a component in your application?

Describe the solution you'd like When an application is consuming CSS builder, we would need to provide functionality where the consumer can instruct CSS builder to show only a specific set of attributes. These can be done in two different way

  1. white-list-tags and black-list-tags
  2. white-list-attributes and black-list-attributes

e.g: Let's take an example of a problem, My application uses css-builder for runtime customization, however,

  1. I don't want end-user to modify the color of any element as it will interfere with my out-of-the-box theme.
  2. I don't want anyone to change the element border due to theme interference again. This is where a whitelist and black list tags will be very useful.
    • A blacklist is the highest priority filter, anything configured in blacklist will never appear on css-builder UI
    • By default all the attributes are considered as whitelist item however when whitelist value is provided, the component will consider every other attribute as blacklist. Coming back to the above problem, we would like to provide a solution to the consumer like
      <CSSBuilder black-list-tags=["color"] black-list-attributes=["border", "border-radius"]/>

      So now no will see any attributes related to color tag and also border and border-radius will be hidden from the end-user.

Describe alternatives you've considered NA

Additional context NA

donjosemathew commented 2 years ago

Can I add some UI Improvements to the website?

koustov commented 2 years ago

Can I add some UI Improvements to the website?

Sure, can you add an issue with your proposal? Once added we will quickly review and assign it to you.