Coder Social home page Coder Social logo

Color management - idea about cookieconsent HOT 4 CLOSED

orestbida avatar orestbida commented on August 16, 2024
Color management - idea

from cookieconsent.

Comments (4)

orestbida avatar orestbida commented on August 16, 2024 1

@DanielMiara yea, as of now the only way to personalize the plugin is by overriding the style via those crazy css classes.

The first option is to go the javascript way (like you suggested), but then users would surely ask to add other features like the ability to define color schemes for both light and dark modes, and mabye additional other properties like button_hover_bg_color, focus_border ...

The other route would be to make the existing css more "ready-to-edit" (maybe by specyfing css variables at the beginning of the .css stylesheet for an easier/immediate management. Something like:

/* Light color-scheme */
--buttons-bg: red;
--buttons-bg-hover: brown;
/*other props ... */

/* Dark color-scheme */
--buttons-bg-dark: white;
--buttons-bg-hover-dark: grey;
/* other props ... */

/** Rest of css style **/

The css solution would be easier to maintain/update (from my point of view at least) but with a catch; for the old browsers which dont support css variables (IE ...), you would have to either include a polyfill or leave it like that (the default dark-blue style would be applied).

All that being said, surely one of the 2 methods will be implemented in the future!

from cookieconsent.

orestbida avatar orestbida commented on August 16, 2024 1

Shouldn't be an issue.

In the upcoming 2.3 release I'll change it so whoever the element with class="force--consent" is (as long as it is a parent container) the css will still apply.

from cookieconsent.

DanielMiara avatar DanielMiara commented on August 16, 2024

Any options to manage the colors will be helpful but now I think the second one will work better :)

BTW: Maybe you can find a better option than force--consent now to force a full screen.
I mean force--consent works good but it's difficult sometimes to get and modify HTML tag.
If we can use just <div class="force--consent" somewhere will be more helpful

Thanks

from cookieconsent.

DanielMiara avatar DanielMiara commented on August 16, 2024

Superb, thanks

from cookieconsent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.