im-richard / scaffold Goto Github PK
View Code? Open in Web Editor NEWExtend, combine and compress CSS
Home Page: http://github.com/IAMRichardT/Scaffold/wiki
Extend, combine and compress CSS
Home Page: http://github.com/IAMRichardT/Scaffold/wiki
I've noticed this currently isn't included with scaffold and there doesn't seem to be any mention of it in the wiki. Has this been removed or will it be showing up again? I personally thought this was one of the better modules included with scaffold and would like to see it make a return.
Thanks,
Liam
I'm trying to implement scaffold and just can'y make parse.php see my css files.
It would be most helpful if somebody could upload a zip file of the most basic working set up that I can look at and compare.
Thanks for your help.
There is a syntax error in CSSTidy.php on line 41,
it's miss a ',' after between the two value/key definitions.
I put a css file in the same directory as parse.php, still can't find it...
Not that that is the solution I'm looking for, but in the near-term to get things rolling, I figured the simplest would be to place it relative to parse.php to be in the same directory so I could just put in the file name...still can't find the file.....I think I'm going to need some explicit examples perhaps if I'm doing something wrong...
Is this project related to http://scaffoldframework.com ?
If so, is there interest in community effort to get an operational site there?
Adding &recache would clear the entire cache in the old Scaffold. I don't see that anywhere in the new. Is that correct? Is there any reason this shouldn't be added to the __contruct method of Scaffold_Cache_File?:
if ( isset( $_GET['recache'] ) ) {
$this->delete_all();
}
Please push content to the scaffold repos soon! With them and http://anthonyshort.com.au/scaffold/docs/ both gone, I'm not aware of anywhere to go for reference.
On http://github.com/anthonyshort/Scaffold
This link gives a 404: http://anthonyshort.github.com/scaffold
It should probably be: http://github.com/anthonyshort/Scaffold/wiki
When I try to install the new version of Scaffold, I have an error :
func_get_args(): Can't be used as a function parameter
I don't understand what's wrong...
Shouldn't Scaffold just generate a .css file, output it to a particular tmp/cache folder, redirect the header to that location - then let the server handle gzipping and everything via .htaccess if necessary?
Or is this what it does? :-)
Is it possible to escape @variable syntax to include semicolons/colons in a variable value? eg:
@variables {
sprite:"background-position: 0 0; width: 26px; height: 27px;";
}
All is in the title... it defeats the purpose of variables...
The file here:
http://github.com/anthonyshort/Scaffold/blob/master/extensions/AbsoluteUrls/AbsoluteUrls.php
Does not seem to support files passed by url:
http://mysite.com/scaffold/parse.php?url=http://someothersite.com/stylesheet.css
Ultimately I'm looking for a solution where I can go:
http://mysite.com/scaffold/parse.php?f=http://someothersite.com/stylesheet.css,style.css,styles/style.css
etc
When forcing a cache refresh (ctrl+f5) scaffold still returns a 304 not modified response.
It seems to me that the problem appers because modified method in Scaffold_Response_Cache class doesn't check if the _modified_since has a proper value. Thus the comparison returns false even if _modified_since is set to 0.
Other problem is that _modified_since is an integer and $last_modified is a string.
Anyway, I'm very glad to see that the work on this project is continuing.
Best regards!
No success in Apache on windows, scaffold just spits out the original css file.
Putting comments inside of an @variables block will break all following variables. eg:
@variables color {
test1:#00a4e4; /* Light Blue */
test2:#042260;
}
#header {
color: color.test1;
background-color: color.test2;
}
Outputs:
#header
{
color: #00a4e4;
background-color: color.test2;
}
Similar to Sass, having an option to import a file without compiling it would be helpful.
Unless I'm doing something wrong, processing a 'master' import-all file (like this master.css) fails because Scaffold attempts to compile each imported file individually and chokes when finding unset variables and/or undefined mixins.
I'm currently adding a small stylesheet switcher to a site, and all that really happens is changing some css colours. It would be pretty cool if we had access to the variables set in scaffold through the url, so something like this could be used.
style.css?brandColor=#F11F12&highlightColor=#001001
@variables colors {
throws an error
@variables colors
{
doesn't
Anyone know if Scaffold is still being actively developed? It's been a year since last commit to the repo.
I know things are being "rebuilt" and that there's lots of docs being done via phpDoc and all, but can we get the old Readme back up so there's clear examples on the front github page or Wiki?
Many deployed codebases are (or should be) read-only.
It'd be great if the Scaffold cache directory could be configured, so that something like /tmp/scaffold-cache could be used in production.
Cheers!
Paul
When our production system was used heavily, some users got empty css files. Looking into the config, I found that in_production
was set to false and force_recache
was set to true. I have reversed the setting and I'm hoping now that problems will go away.
I'm assuming that with my original settings the cache files were deleted while another process was reading them. Can anyone confirm that?
Maybe it would be good to put a big warning in the description for in_production
. Or to implement a file locking mechanism for the File cache class.
At the moment relative paths without "../" like "images/image.jpg" or with multiple "../" like "../../images/image.jpg" are not resolved correctly.
Looking into the Scaffold_Extension_AbsoluteUrls class I've discovered few issues.
After making this modifications I've run tests for each case and it works.
Best regards!
It looks like the Sass.php extension is trying to load cache files with the .sass extension but they are not stored that way.
Changing $temp = $scaffold->cache->find('/sass/'.$source->id.'.sass'); to $temp = $scaffold->cache->find('/sass/'.$source->id);
and commenting out the throw exeption code seems to fix the issue.
The configuration settings for the Sass extension also seem to have not effect on the output.
Other than that I like what I see!
In the old version there was a mixins directory which contained a whole bunch of mixins, or you could add your own.
What is the equivalent in the new version?
I've been using the "sunny" version of CSScaffold, and loving it. I'm very interested in the current rewrite that is underway. Is there documentation somewhere that highlights the reasons and goals for the rewrite, as we all as pointing out syntax and/or feature differences?
Thanks!
A basic newb question, but how do I combine more than one css file? The wiki suggests that it can be done, but there are no examples and the tests I did didn't work.
Cheers
Jim
Could the solutions here:
http://www.smashingmagazine.com/2010/04/28/css3-solutions-for-internet-explorer/
Or here:
http://css3pie.com/about/
Become standard?
In set and exists methods the the following code is used:
$file = $this->directory.$id;
and I think it should be:
$file = $this->find($id);
In
https://github.com/anthonyshort/Scaffold/blob/master/extensions/Sass/Sass.php
and
https://github.com/anthonyshort/Scaffold/blob/develop/extensions/Sass/Sass.php
Line 60 is currently:
$temp = $scaffold->cache->find('/sass/'.$source->id.'.sass');
I think it should be:
$temp = $scaffold->cache->find('sass/'.$source->id.'.sass');
Thanks for all the hard work on this.
I found that the following resulted in incorrect CSS and the olive-light colour was not applied:
@variables colors {
olive-light:#D0D6AB;
olive:#BAC28A;
....
I swapped the first two variables around, and the olive-light colour CSS was then fine:
@variables colors {
olive:#BAC28A;
olive-light:#D0D6AB;
....
In our CMS we are using Scaffold (well the old version). Originally we passed the CSS files via the urls as indicated in the Wiki by doing:
<link rel='stylesheet' href='/scaffold/parse.php?file=/path/to/file.css />
In the older version we always had issues with Scaffold stuffing up url() CSS properties, so rather than rewriting we came up with the following .htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteCond %{REQUEST_URI} \.css$
RewriteCond %{QUERY_STRING} csscaffold
RewriteRule ^(.+)$ styles/csscaffold.php?f=%{REQUEST_URI}&%{QUERY_STRING}
</IfModule>
This way we can still reference our CSS normally without touching our HTML files at all.
<link rel='stylesheet' href='/path/to/file.css />
All the old CSS that doesn't use Scaffold works perfectly. And we can include a new scaffold CSS file by using:
@import url("./csscaffold.css?csscaffold");
What do you think about being able to set certain config options from within the CSS itself?
for example
@scaffold {
cache: false;
compress: false;
}
More options then those two could be changed of course.
I think being able to change options for different CSS files could be useful while in development and could be ignored while in production?
It's great to see Scaffold being rewritten entirely, it's going to be better and better ! The only fact that all classes are now namespaced is great for integration with CMS (I am a maintainer of the Drupal module providing Scaffold integration with Scaffold). It will be more extensible and seems much cleaner, great work so far !
I played a little with the current version (from july the 15th), but I could not make any extension work, and I was wondering if it is normal at this stage of the rewrite or if it may be a configuration issue. I did set $config['extensions'] and looking at the code, it seems that extensions should process the css, but could not get any result.
Do you have any idea of when a first usable version may be released ?
Keep up the good work.
what is the format for adding paths to the load_path array?
The documentation just shows the default configuration, but no example of how to add new paths....what are some examples of the format?
plese check link http://woo-like.com an said with me what's happen for this site?
On FF, Chrome and Safari css load ok, but IE not working.
I don't kown why?
Thanks.
Hi I'm having trouble with the initial setup of the scaffold I've followed the basic setup from the wiki but am a little bit stumped.
My file tree looks like this:
myscaffold
index.html
css
style.css
scaffold
The link from index.html is this:
link href='scaffold/parse.php?file=css/style.css' rel='stylesheet' type='text/css'
(with < /> removed so code swhows up here)
and I have some ipsum text with a container
And in my css file is this:
.container {
background-color:yellow;
}
So if it is working there should be a yellow background with the container which there isn't, if I call the stylesheet without parsing through the scaffold the background shows up. So I'm a little stumped at present.
I would be interested in writing up a bit more on a through setup walk through if I can get this sorted.
Thanks,
Kerry
I came accross a case where I needed to have a property in 2 different mixins, but wanted them to be combined when applied to a rule. E.g. :
=mixin1 {
filter: opacity(alpha=50);
}
=mixin2 {
filter: progid:DXImageTransform.Microsoft.DropShadow(color=#000000, OffX='1', OffY='1');
}
.selector {
+mixin1;
+mixin2;
}
Would give :
.selector {
filter: opacity(alpha=50) progid:DXImageTransform.Microsoft.DropShadow(color=#000000, OffX='1', OffY='1');
}
This is useful for MSIE filters but also for some CSS3 stuff like multiple backgrounds, transitions etc.
Hi!
I have a problem with the last version of Scaffold. This is the error message i get:
simplexml_load_string(): Entity: line 1: parser error : attributes construct error
On the file :
[PATH TO SCAFFOLD]scaffold/extensions/NestedSelectors/NestedSelectors.php [140]
And this is my css file (I am still testing Scaffold) :
body
{
color: blue;
}
Where is the problem?
Julien FASTRE
Put a mixin in the main stylesheet, everything's fine. Move that mixin to something like @import 'mixins.css', no dice.
Hi everybody,
rob-linux-laptop# cat test.html
"
html
head
link href="scaffold/parse.php?file=/test.css" rel="stylesheet"
head
body
p class="aa"
rrrrrrrrrrr
/p
/body
html
rob-linux-laptop# cat const.css
@Constants
{
bb: red; /* red */
}
rob-linux-laptop# cat test.css
@include './const.css';
p.aa{
color: $bb;
}
When I open the browser I have got the:
rrrrrrrrrrr
without red
In page source i click:
http://example.com/scaffold/parse.php?file=/test.css
and receive:
@include './const.css';p.aa{color: $bb}
this is $bb not red
What wrong with my cod?
I use:
php 5.3.2
apache 2.2.14
(I omit httm tags)
For any suggestion I greatly appreciate
Best regars Robert
(sorry for my england)
I see the rewrite has made a lot of progress, and it's brilliant ! I can't wait for the functions to be implemented.
Using Scaffold a lot these times, I was thinking that a generic Color class would be a great thing to have. What I mean by "generic" is a function that would let us manipulate and convert colors from one single function. It would take a color as input, have an output format and return the reformatted color.
This would give "color input" -> "color output" :
background: color(#FF0000, rgb); // would output rgb(XXX, XXX, XXX);
background: color(rgb(250, 134, 155), hex); // would output #XXXXXX;
background: color(hsla(250, 134, 155, 80), rgba); // would output rgba(XXX, XXX, XXX, XXX);
background: color(rgba(250, 134, 155, 50), image); // would output url(path/to/transparent-image.png);
and so on...
Another thing that could be great would be the ability to manipulate those colors using rgb or hsl :
background: color(hsl-adjust(#FF0000, +10, -10, +20), rgb);
background: color(rgb-adjust(#FF0000, +100, -50, +20), hex);
The implementation is to be thought a little more obviously, but you get the idea. Maybe it could be pluggable to handle some more cases.
Any thought ?
Is there a syntax like calc() for doing math with variables in the new version?
Hi Anthony,
Liking it so far, but...
When I add a /* Comment */
, it turns out like this in the generated CSS:
<comment_block> Comment </comment_block>
And when I use a @ inside my comment, like /* @Group Blah */
, I get this warning:
simplexml_load_string() [function.simplexml-load-string]: Entity: line 11: parser error : Unescaped '<' not allowed in attributes values
I really like using @group, because it creates nested groups in the navigator pane in Espresso (and CSSEdit).
Maybe I'm doing something wrong though. Thanks for your help!
Roel
Has it reached usable yet?
Because Properties hooks into pre_process and Variables hooks into process, custom properties such as image-replace are unable to take variables.
Switching Properties to process and Variables to pre_process resolves the issue, but I don't know if that has any adverse effects.
Example:
@variables img {
someimage: /test.jpg;
}
#test {
image-replace: url(img.someimage);
/* returns url(img.someimage), not url(/test.jpg) */
/* parses to: background:url(/test.jpg) no-repeat 0 0;height:0;padding-top:0px;width:0px; ... */
/* Because image is not found, so no dimensions are set, THEN the variable gets replaced after image-replace has run */
/* With hook order switched dimentions are filled in: */
/* background:url(/test.jpg) no-repeat 0 0;height:0;padding-top:460px;width:320px; ... */
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.