{"id":1334,"date":"2018-01-19T19:22:43","date_gmt":"2018-01-19T19:22:43","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/php-enabled-stylesheets\/"},"modified":"2018-01-19T19:24:42","modified_gmt":"2018-01-19T19:24:42","slug":"php-enabled-stylesheets","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/php-enabled-stylesheets\/","title":{"rendered":"PHP enabled stylesheets"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Bertrand Potier<\/div>\n<div class=\"\">on November 24, 2002<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<h2>Introduction<\/h2>\n<div class=\"articlePara\">CSS Stylesheets are a major improvement in the World Wide Web, allowing HTML<br \/>\nto come back to its roots: a language to structure and publish content on the<br \/>\nweb, not to apply a visual formatting to that content. Unfortunately HTML and<br \/>\nCSS have the same limitations: both are static languages!<\/div>\n<div class=\"articlePara\">\nFrom Perl scripts to PHP, a lot of technologies are today available to move HTML to the dynamic<br \/>\nage but why not, going even further and do the same with CSS? That&#8217;s what I did<br \/>\nwhen developing <a href=\"http:\/\/edreamers.org\/?folder=cons&amp;name=eDContainer\" target=\"_blank\">eDContainer<\/a> (a container for web sites and web applications),<br \/>\nhaving the following objectives in mind: <\/div>\n<div class=\"articleList\">\n<ol>\n<li>To provide an external, user-friendly, visual configuration file: the user<br \/>\n  doesn&#8217;t have to edit the stylesheet, he may not be familiar with CSS and even<br \/>\n  if so, properly editing a stylesheet requires some experience. <\/li>\n<li>To not have to repeat general identical values like fonts and colors x<br \/>\n  times within the stylesheet: the value is defined once in the visual<br \/>\n  configuration file and inserted automatically by PHP in the different<br \/>\n  locations within the stylesheet.<\/li>\n<li>To provide a solution to the implementation of skins or themes (similar to<br \/>\n  Winamp or Windows XP principles): several different visual configurations can<br \/>\n  be defined and dynamically switching from one to the other is possible. <\/li>\n<li>To be able to change some style behaviors dynamically, depending on some<br \/>\n  configuration values. <\/li>\n<\/ol>\n<\/div>\n<div class=\"articlePara\">If you&#8217;re quite familiar with PHP and CSS, reading the above objectives will<br \/>\nprobably make you already think about some solutions to achieve them. That&#8217;s the<br \/>\nfun about coding, always different and sometimes better ways to obtain the same<br \/>\nresults! When writing this article, I&#8217;m not saying that what is described here<br \/>\nis the only way to do it. It&#8217;s a way and I hope I&#8217;ll manage to keep you<br \/>\ninterested: Let&#8217;s start! <\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">1<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211224658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211229ba9.html?page=3\">3<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122c575.html?page=6\">6<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122235c.html?page=7\">7<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdfa.html?page=8\">8<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211220b08.html?page=9\">9<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211221448.html?page=10\">10<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"potier200211224658.html?page=2\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>From Perl scripts to PHP, a lot of technologies are today available to move HTML to the dynamic age but why not, going even further and do the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1334","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1334","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1334"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1334\/revisions"}],"predecessor-version":[{"id":3220,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1334\/revisions\/3220"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1334"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1334"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1334"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}