Lasso and CSS

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Lasso and CSS

Patrick Larkin-2

Before I do something stupid, I thought I'd check in to see if anyone is using Lasso in CSS files.  And if so, how?

For instance, I have a box with a background image I'd like to randomize with different photos.  

.myBox{
  ...blah...
  background-image: url(/img/myPhoto.jpg);
 ...blah...
}

I'd like to change the image using Lasso.  The problem is the CSS file has a css extension.  Do I add css as an extension Lasso will parse and then put Lasso code in there or is there some other way to do this?  Perhaps add inline CSS to the page and use Lasso code in there?  



Patrick Larkin
Developer/Administrator of Special Systems / Webmaster
Bethlehem Area School District




#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso and CSS

Jolle Carlestam-3
I've never been comfortable having Lasso process css or javascript files. Seems like a waste of capacity.
If I had the same need as you describe and wanted to use css rules I'd place that css snippet in the lasso file directly.

If you're to use it in several places do an include.

HDB
Jolle

4 feb 2013 kl. 19:10 skrev Patrick Larkin <[hidden email]>:

>
> Before I do something stupid, I thought I'd check in to see if anyone is using Lasso in CSS files.  And if so, how?
>
> For instance, I have a box with a background image I'd like to randomize with different photos.  
>
> .myBox{
>  ...blah...
>  background-image: url(/img/myPhoto.jpg);
> ...blah...
> }
>
> I'd like to change the image using Lasso.  The problem is the CSS file has a css extension.  Do I add css as an extension Lasso will parse and then put Lasso code in there or is there some other way to do this?  Perhaps add inline CSS to the page and use Lasso code in there?
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso and CSS

Mason Miller
In reply to this post by Patrick Larkin-2
css files do not have to have the css extension. Set up an extension like lccs for the css files you want lasso to process and then use those and leave normal css files alone. Or, put the css in an include file that lasso processes.

Mason

On Feb 4, 2013, at 1:10 PM, Patrick Larkin <[hidden email]> wrote:

>
> Before I do something stupid, I thought I'd check in to see if anyone is using Lasso in CSS files.  And if so, how?
>
> For instance, I have a box with a background image I'd like to randomize with different photos.  
>
> .myBox{
>  ...blah...
>  background-image: url(/img/myPhoto.jpg);
> ...blah...
> }
>
> I'd like to change the image using Lasso.  The problem is the CSS file has a css extension.  Do I add css as an extension Lasso will parse and then put Lasso code in there or is there some other way to do this?  Perhaps add inline CSS to the page and use Lasso code in there?  
>
>
>
> Patrick Larkin
> Developer/Administrator of Special Systems / Webmaster
> Bethlehem Area School District
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

Mason Miller
Managing Partner
SiteWelder, L.L.C.
[hidden email]



#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso and CSS

Bil Corry-3
In reply to this post by Patrick Larkin-2
I recommend a different approach to avoid dynamic CSS files.

Instead specify the background img as:

   /img/photo.lasso

Then use Lasso to serve a random image using file_serve with proper content-type and no-cache headers.

- Bil

On Feb 4, 2013, at 7:10 PM, Patrick Larkin <[hidden email]> wrote:

>
> Before I do something stupid, I thought I'd check in to see if anyone is using Lasso in CSS files.  And if so, how?
>
> For instance, I have a box with a background image I'd like to randomize with different photos.  
>
> .myBox{
>  ...blah...
>  background-image: url(/img/myPhoto.jpg);
> ...blah...
> }
>
> I'd like to change the image using Lasso.  The problem is the CSS file has a css extension.  Do I add css as an extension Lasso will parse and then put Lasso code in there or is there some other way to do this?  Perhaps add inline CSS to the page and use Lasso code in there?  
>
>
>
> Patrick Larkin
> Developer/Administrator of Special Systems / Webmaster
> Bethlehem Area School District
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Lasso and CSS

Marc Vos
In reply to this post by Patrick Larkin-2
Leave your CSS as is so it always begins with a background, then add this jQuery script:

[
var(lassoImage' = '/img/apicture.png');
]

...
...

<script>
$(".mbox").css('backgroundImage','url(images/[$LassoImage])');
</script>

- -
Marc

On 4 feb. 2013, at 19:10, Patrick Larkin <[hidden email]> wrote:

>
> Before I do something stupid, I thought I'd check in to see if anyone is using Lasso in CSS files.  And if so, how?
>
> For instance, I have a box with a background image I'd like to randomize with different photos.  
>
> .myBox{
>  ...blah...
>  background-image: url(/img/myPhoto.jpg);
> ...blah...
> }
>
> I'd like to change the image using Lasso.  The problem is the CSS file has a css extension.  Do I add css as an extension Lasso will parse and then put Lasso code in there or is there some other way to do this?  Perhaps add inline CSS to the page and use Lasso code in there?  
>
>
>
> Patrick Larkin
> Developer/Administrator of Special Systems / Webmaster
> Bethlehem Area School District
>
>
>
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>