Using w3.css themes with theme driven border colors

68 Views Asked by At

Is there a way to derive element borders based on current them colors? I'd like to put a border around my but I want to base the borders on my theme colors without also applying the theme color to the content.

My needs to give customers the option of changing themes so I can't hard code the color.

1

There are 1 best solutions below

0
L. Alejandro M. On

If you take a look at W3.CSS Color Generator you can see in the generated css two items related to borders: .w3-border-theme and .w3-hover-border-theme. As you see, both are derivated from your theme (color) but as an integrated whole isn't designed to be changed separately.

If you want change just the border you could use the classes:

  • w3-border-color
  • w3-hover-border-color

being color one of the predefined colors (and remember you must add the class w3-border too).