Welcome Guest, Not a member yet? Register   Sign In
Assets 1.0.0
#1

[eluser]Boris Strahija[/eluser]
Assets turned 1.0.0 today
Github: http://bstrahija.github.com/assets/
Spark: http://getsparks.org/packages/assets/versions/HEAD/show

Some of the supported features:
- LESS CSS
- CoffeeScript
- combine/minify
- groups
- image helpers
- supports Twitter Bootstrap (2.0.1 for now)

Some plans:
- CDN assets
- IE conditionals

You can install it as a spark, but it's also possible to use it as a simple library/helper. I will add docs ow to do it a little bit later today, it's actually really simple.

Would be grateful for feedback Wink
#2

[eluser]kanjimaster[/eluser]
The latest dev version of lessc.inc.php, though still carrying the 0.3.3 version number, has some recent fixes that seem to solve the problems with Twitter Bootstrap 2.0.2.

Simply replacing the contents of Assets lessc.php file with those from https://github.com/leafo/lessphp/blob/ma...sc.inc.php, solved the problems for me with no ill effects noticed to date.
#3

[eluser]theshiftexchange[/eluser]
edit: nevermind - sorted this bit out
#4

[eluser]theshiftexchange[/eluser]
great spark! I've just started using it!

Question - is there any way to put the following type of CSS load in? I tried a few things - but the page keeps failing - I have to load this CSS manually?

Code:
<!-- Internet Explorer Fixes Stylesheet -->
  <!--[if lte IE 7]>
    <link rel="stylesheet" href="<?=BASE_URL?>assets/css/ie.css?version=2" type="text/css" media="screen" />
  <![endif]--&gt;
#5

[eluser]Boris Strahija[/eluser]
[quote author="kanjimaster" date="1333749164"]The latest dev version of lessc.inc.php, though still carrying the 0.3.3 version number, has some recent fixes that seem to solve the problems with Twitter Bootstrap 2.0.2.

Simply replacing the contents of Assets lessc.php file with those from https://github.com/leafo/lessphp/blob/ma...sc.inc.php, solved the problems for me with no ill effects noticed to date. [/quote]

Very nice, It will definitely make it into the next version which is coming in a few days. You can help test it out, just download the develop branch from github.

It has some options like CDN assets and conditional comments.
#6

[eluser]Boris Strahija[/eluser]
[quote author="theshiftexchange" date="1333780259"]great spark! I've just started using it!

Question - is there any way to put the following type of CSS load in? I tried a few things - but the page keeps failing - I have to load this CSS manually?

Code:
&lt;!-- Internet Explorer Fixes Stylesheet --&gt;
  &lt;!--[if lte IE 7]>
    &lt;link rel="stylesheet" href="&lt;?=BASE_URL?&gt;assets/css/ie.css?version=2" type="text/css" media="screen" /&gt;
  <![endif]--&gt;
[/quote]

This will be possible in the new version through the Assets::condtitional method. It is currently available for testing on github in the develop branch.
#7

[eluser]theshiftexchange[/eluser]
Thanks Boris,

For now I'm doing a workaround until the new (stable) version is released

Code:
&lt;?php if ($this->agent->is_browser('Internet Explorer'))
    {
           Assets::js_group('ie', array('ie.js'));
     }
?&gt;


Meanwhile - one more question:

How can I append media="screen" onto the css?

i.e. from this:

Code:
&lt;link rel="stylesheet" href="http://localhost/public_html/assets/cache/20120403103709.css"&gt;

to this:

Code:
&lt;link rel="stylesheet" href="http://localhost/public_html/assets/cache/20120403103709.css" media="screen"&gt;
#8

[eluser]Boris Strahija[/eluser]
[quote author="theshiftexchange" date="1333951552"]Thanks Boris,

For now I'm doing a workaround until the new (stable) version is released

Code:
&lt;?php if ($this->agent->is_browser('Internet Explorer'))
    {
           Assets::js_group('ie', array('ie.js'));
     }
?&gt;


Meanwhile - one more question:

How can I append media="screen" onto the css?

i.e. from this:

Code:
&lt;link rel="stylesheet" href="http://localhost/public_html/assets/cache/20120403103709.css"&gt;

to this:

Code:
&lt;link rel="stylesheet" href="http://localhost/public_html/assets/cache/20120403103709.css" media="screen"&gt;
[/quote]

For now the media parameter is not supported, If you need it you can open a new ticket on Github and I'll consider adding it.

In my opinion it's better to use media queries inside the main CSS files:

Code:
@media screen{
    #main { width: 960px; }
}




Theme © iAndrew 2016 - Forum software by © MyBB