New variable themes
|
griffinmt
![]()
Joined: 2009-09-06
Posts: 128 |
Posted: Sat, 2009-10-24 04:37
|
|||
|
I have a modified theme from the original default some time ago, and have kept up with changes that were needed. I think I have most of the 'structure' taken care of, but now, instead of the many shades of gray in the theme, I would like to make a number of changes into some lighter pastel colors. The first thing I did was to make a copy of my screen.css file and named it screen.master. Quote:
$plasticblue: #5382bf ; Then, in the views folder I wrote a small class module (enhanced_css.php) that, when used at the beginning of the page.html.php module, would read the .master file, replace (and remove) the variables, and write it back out as screen.css. It would only do this if .master was newer. Now it will be easier to start making the changes (and expanding on the variables used) incrementally or en-masse. I got this idea (and much of the code examples) off the web (no restrictions)and mofified it to work with the combined css approach. Attached is the class module. Quote:
<?php defined("SYSPATH") or die("No direct script access.") ?> <!-- existing --> And a sample chunk of screen.master: Quote:
/* Martyn T. Griffin
|
||||


Posts: 22888
Martyn.
Perhaps you and vizion/vizion2000 could get together and come up with something together.
He has similar, but in my opinion, grandiose ideas, creating a configuration file for changing layout and color/colour.
http://gallery.menalto.com/node/91832
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 128
I think what I did is a very simplex solution for ease of use, not a full redo that he (she) has in mind. But parts are similar.
I did mine for manipulation the colors, but it also works on all the css attributes, such as those controlling size and positioning.
It's just "version 0.1", but the class can easily be expanded to perform calculations with the variables etc. I had planned to extend it to support multiple color sets, making them appear randomly from session to session.
I suppose that the variable definitions can be stored in a discrete file, but my way always leaves a .css file that is clean and never needs direct manipulation.
Martyn T. Griffin
Posts: 128
After looking at some other discusions on related subjects, I made a change to the way this runs.
1) Seperated the variable definitions from the css file and modified the class accordingly.
2) Added in support for multiple color scheme within the theme.
3) Put in a simple display page to show all the colors for each scheme along with the color value and the variable name for it.
Attached is a sample of the display output.
The scheme and color selections are only a starting pass!
Martyn T. Griffin
Posts: 128
OK, I admit it, I am useless with regular expresions!!!
I need to change one and don't know were to start!
This pulls out of the variable $line all the occurences of '$xxx: yyyy;' as well as '$zzzz;', dropping the $ sign in the process.
What I need to do is to be able to extract '$xxxx: rgb(...);' as well (in any case).
Anyone to help me?
Martyn T. Griffin
Posts: 128
The regular expresion issue above is resolved.
As far as the messed up header/body content is concerned, since no-one had any suggestions, I canned that approach and changed it all to just a bunch of functions, including and executing between the </head> and <body> definitions.
Also, the standalone utility for dispaying the variable definitions was altered to ket it update the .defs file directly.
Martyn T. Griffin
Posts: 3
Do you have any new code for this, or has the original post been updated?
I may need to develop something for a client that will allow him to apply a different tiled background to any album. I think I could perhaps add a custom field to the album details (along side title, description, ect) for a background image url, and pass this value to the css via your method.
What do you think?
Posts: 39
..