Customizing the styles on your website based on button clicks is a simple task. You just need to detect when the button is clicked and then apply the appropriate stylesheet. You can even have different styles for different buttons, like a theme changer feature. Here's the code snippet to achieve this:
$('button.summer').click(function() {
$('head').append('<link rel="stylesheet" href="assets/css/summer.css">');
});
$('button.winter').click(function() {
$('head').append('<link rel="stylesheet" href="assets/css/winter.css">');
});
When the button with the class "summer" is clicked, the summer.css stylesheet will be added to the head section of your page. Similarly, clicking the winter button will add the winter.css stylesheet.
This method involves creating separate stylesheets for specific themes, while keeping common styles in a main stylesheet like general.css or style.css. This way, the custom styles don't replace the overall theme stylesheet but complement it by adding unique styling elements as needed.
By following this approach, you can easily customize and enhance the appearance of your website based on user interactions. Hopefully, this explanation helps you implement these changes effectively.