Note that there are some explanatory texts on larger screens.

plurals
  1. POGranular control over site styles with css
    text
    copied!<p>I've been trying to wrap my head around a good way to do this, but so far have come up empty, and needed some guidance.</p> <p>Basically, what I have at the moment is a style selector, which gives 10 pre defined styles for the site that a user can choose from. Most of them are grotesque, and are merely proof of concept.</p> <p>This is controlled by PHP and mysql. When a user logs in, and slects a non-default style, it is added against their user record in the DB. The site then refreshes, and loads the selected style.</p> <p>It works really well, but now I want to try and have some granular control. For example, I would like users to be able to pick their own header background colour, heading text colour, sub heading colour and some font sizes.</p> <p>It is a fairly trivial thing, and if I can't find a way to implement it, then so be it.</p> <p>My initial thought was to have a table that has columns for each customizable part of the size, e.g. font size, colours etc. In the table, would be a record for each user. They then use some interface to pick and choose what they want, and then add it to the table.</p> <p>My issue, was then what to do with the values that I retrieve from the DB. I would have liked to insert them straight into a CSS file, but I don't think this is possible without some server configuration changes, that I couldnt get to work.</p> <p>So does anyone have any suggestions on the best way to do this, if there is any way at all.</p> <p>Regards Eds</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload