Custom styling based on users choice

I remembers years ago when CSS was just introduced to the WWW developers one of the pioneers created a series of web pages that had the same content and media – read images, images were equivalent of web based apps of the day –  but different styles. It was breath-taking and everyone was talking about it. The whole social media – read forums, they were twitters/facebooks of those days – was buzzing – read posting – around it and web developers were eagerly trying to mimic something similar. The mentioned developer had created a few pages and each page had different set of CSS rules specially over positioning the elements as the result each page looked and felt – well, actually “feel” is a new concept today as well – differently.

Today in the post-cms era it is expected to have separately-styled pages even on the most basic web sites so I have decided to challenge myself over creating clones of this site with separate styles based on the users preference.

One obvious solution would be a setting page that allows logged in users to choose which “look and feel” they would prefer and presenting that style for the specific users but that would need users to register and log in first which isn’t what I have in mind. I want a simple drop down menu with pre-defined options that user can choose and outputting the whole site according to that choice.

Another obvious but this time too simple solution is that we just change the style of current page based on the option selected but the setting would be lost as soon as the user follows a link on the page.

So far I have come up with the third on which is using wordpress cookies. If the users doesn’t have a cookie set we output the default otherwise the style stored inside the cookie. This cookie remains side-wide and the selection would be remembered when the user returns to the side. Lets see how it’s going ….

Update: 12 Nov 18
It actually worked and now I have two completely different design on the site with the same content based on the user choice. I like it.

Custom styling based on users choice

Leave a Reply

Your email address will not be published. Required fields are marked *