Giter Club home page Giter Club logo

scaffold's People

Contributors

balupton avatar pdclark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

scaffold's Issues

Layout/Grid Module

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

Anyone have an example set up I can look at?

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.

I put a css file in the same directory as parse.php, still can't find it...

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...

&recache

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();
}

error in installation

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...

Why is there gzipping in Scaffold?

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? :-)

Variable escaping?

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;";
}

304 response even on forced cache refresh

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!

Comments break @variables blocks

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;
}

Support for (import) partials

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.

Changing vars through GET request

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

Project status?

Anyone know if Scaffold is still being actively developed? It's been a year since last commit to the repo.

Documentation

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?

Configurable cache path.

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

in_production + force_recache + Many Users = No CSS?

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.

AbsoluteUrls resolving paths problem

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.

  1. up_directory should not be called in resolve_absolute_path or it should do nothing unless "../" exists in the path. As a quick solution "if (!$n) return $path;" should be the first line in up_directory.
  2. as $path has a trailing slash the last element of $explode is an empty string. So we want to remove $n + 1 elements from the end of $explode: $exploded = array_slice($exploded, 0, (count($exploded) - $n - 1));
  3. for consistency, up_directory should return a path maintaining the trailing slash. So after slicing the $exploded array it should add an empty element ($exploded[] = '';) so that implode will add that trailing slash.
  4. when resolve_absolute_path returns the path it should replace "../" with empty string not "/".

After making this modifications I've run tests for each case and it works.

Best regards!

Sass

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!

Documentation about reasons and goals of rewrite?

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!

How to Combine files?

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

Hyphen in first variable name (0.0.29)

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;
    ....

How I use Scaffold with a .htaccess

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");

Config within CSS

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?

State of the ongoing rewrite

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.

Having trouble with setup

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

A "MultipleRule" extension

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.

elementary example

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)

A more generic Color extension

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 ?

calc()?

Is there a syntax like calc() for doing math with variables in the new version?

CSS Comments

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

Properties can't use Variables

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; ... */
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.