Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: Better CSS
One of your main objections was that css.php was inside the textpattern directory. It no longer is (well, for compatibility reasons, but that’s not an issue for you).
So the only other thing is the URL. Do visitors really care what URL is used for serving CSS? I don’t think so. Let’s focus on things that really need to be improved, before dealing with stuff like this ;)
Offline
Re: Better CSS
no the visitor will not care. but then again the visitor will also not care your even using Textpattern.
BUT the guy behind the scenes cares (well i do) about the efficiency and consistency of files with a website.
~ Cameron
Offline
Re: Better CSS
Bloke wrote:
I would very much like to have the option of CSS in the file system and/or in the DB natively. Treating the file system version like a cache makes sense to me as well. But again: I’m a geek not a designer so this sort of thing is on my radar. Might not be for people of a non-cody mindset?
I’m a designer first, geek second. I’ve launched a whole lot of TXP sites using static CSS files in the file-system, and one or two (very simple designs) that used Textpattern’s CSS tab. Speaking for myself, it never made sense to keep CSS in the database, and I’d be interested in knowing if I’m missing out on the benefits. To me, it seems that the file system offers a lot. In addition to the speed differences already mentioned:
- Static files can be kept in version control.
- Static files are easier to edit in specialized authoring tools. The SASS compiler I’m using to style a TXP-based discussion site I’m working on offers way more than I would ever reasonably expect from Textpattern (shorthand, variables/mix-ins, compression).
- Static files give you absolute control over URL structure.
A few of these things are possible without abandoning Textpattern’s CSS suport as I have, to wit: I use cnk_versioning to keep all my templates in the file system during development. It automatically imports pages, forms, and styles with each refresh when the site’s production status is not Live. One could easily get the best of both worlds using this plugin.
This isn’t a complaint about Textpattern at all. I don’t look to Textpattern to be a top-notch CSS-editing tool— it’s awesome enough without that. Were I publishing stylesheets as downloads like David DeSandro (BBHSHTCL), maybe I would lean more on Textpattern for this. But for now, I’m content with keeping Textpattern agile and powerful with other kinds of content.
Last edited by johnstephens (2009-08-09 01:50:41)
Offline
Re: Better CSS
In thinking about it, I’m realizing that there is no specific advantage to having the CSS maintained within the DB. Accessing flat files directly would be marginally faster than by the dB method. Perhaps the CSS editing tool can be revised so that it loads/saves it as a flat file within a CSS specific directory? The only drawback to that would be that the CSS directory would need to be writable, and that can create some security issues.
Oh, and just to clarify, I am by no means agreeing with Driz. THAT would never happen.
Last edited by TheEric (2009-08-09 19:41:04)
Offline
Re: Better CSS
It’s not a security issue. The images/files directory is also writable.
Accessing static CSS files from a visitor perspective is not marginally faster. The speed difference is huge! That’s why I wrote rvm_css.
From an admin side point of view, moving from DB to flat file storage makes no sense at all. There is no noticeable speed difference there.
Offline
#21 2009-08-10 02:06:42
- Mary
- Sock Enthusiast
- Registered: 2004-06-27
- Posts: 6,236
Re: Better CSS
Writing to files only would also be one more location you have to backup. At least when you’ve got the static+db copy, you only have to backup the db to have the style info saved.
Offline
Re: Better CSS
TheEric wrote:
Oh, and just to clarify, I am by no means agreeing with Driz. THAT would never happen.
It’s times like this when I wish this board had proper smileys!
;0)
Keith
Blyth, Northumberland, England
Capture The Moment
Offline
Re: Better CSS
Mary wrote:
Writing to files only would also be one more location you have to backup. At least when you’ve got the static+db copy, you only have to backup the db to have the style info saved.
Backup/portability. Definitely a benefit imho.
Plus, if I have to tweak css when I’m not at my own computer, it’s very simple when the css is in the database.
Offline
Re: Better CSS
I think Textpattern has it right. The CSS belongs in the database. The way to get the best of both worlds is to integrate full-page static caching into the core, and cache CSS files along with content pages. The result would be that the CSS is backed up and transportable along with the rest of the database, but is served at full static file speed (after the initial request).
Offline
Re: Better CSS
artagesw wrote:
The way to get the best of both worlds is to integrate full-page static caching into the core, and cache CSS files along with content pages.
That would be the best of a whole lot of worlds. 4.2.1+?
Offline
Re: Better CSS
I wouldn’t mind seeing rvm_css integrated into core. However, that would require more restricted CSS style names to make good filenames (my plugin tries to do the right thing, but there are situations where it can fail). Since that is almost guaranteed to break things (for people that have weird CSS style sheet names), getting rid of the base64 encoded CSS in the database would be a good thing to do at the same time (as well as deleting the css editor that nobody uses).
Offline
Re: Better CSS
ruud wrote:
I wouldn’t mind seeing rvm_css integrated into core …getting rid of the base64 encoded CSS in the database would be a good thing to do at the same time (as well as deleting the css editor that nobody uses).
All get my vote. Getting rid of base64 and that ridiculous editor should make TXP fit on a postage stamp ;-)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Hire Txp Builders – finely-crafted code, design and Txp
Offline
Re: Better CSS
I’ve started to use an external css file for easier editing and also to reduce database/server calls
Offline