我的网站的主题选择器和主题预览
我正在尝试找到一种使用 PHP 在我的网站构建上实现主题选择器的解决方案。
登录后,用户会看到可用的主题,所选主题将存储在他的个人资料中。
但是如果用户愿意用自己定制的颜色来改变当前主题的颜色,那么我该怎么做呢?
我查看了 yui 应用程序主题,但不知道它是否适合我的需求。 非常感谢任何帮助。
谢谢
I am trying to find out a solution for implementing themes selector on my website build using PHP.
After logging in a user is presented with the available themes, and the one that is selected get stored in his profile.
But if a user is willing to change the colour of his current theme with his own customized colour, then how shall I do this.
I looked at yui App theme but don't know if it will suit my needs.
Any help is greatly appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CSS 可以从 PHP 脚本输出,因此只需执行以下操作:
css.php:
“主题”可以只是一个调色板,或者您可以拥有一组完全不同的样式表。用户选择一种,然后可以选择为其选择颜色。
所有这些都应该得到正确版本控制的支持,以便用户仅在更改首选项或基本样式表更改时才下载样式表。
预览有点难。为此,您可能需要一个专门用于此目的的自定义样式表,并使用 Javascript 动态更新样式表,以便用户可以立即看到更改。这是一项更为实质性的工作。
CSS can be output from a PHP script so just do something like:
css.php:
The 'theme' can just be a palette of colours or you can have a set of stylesheets that are more radically different. The user chooses one and then optionally chooses colours for it.
All this should be supported by correct versioning so the user only downloads the stylesheet when they change preferences or the base stylesheet changes.
Preview is a little harder. For this you'll probably need a customized stylesheet just for this purpose and use Javascript to dynamically update the stylesheet on the fly so the user can see the changes immediately. This is a far more substantial piece of work.