# Is it possible to let users define/customize their own stylesheets?

**URL:** <https://www.ruby-forum.com/t/is-it-possible-to-let-users-define-customize-their-own-stylesheets/136570>\
**Category:** Rails\
**Created:** [May 3, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-let-users-define-customize-their-own-stylesheets/136570 "2008-05-03T19:42:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vince](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b5e925/32.png) [@vince](https://www.ruby-forum.com/u/vince)\
**Post date:** [May 3, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-let-users-define-customize-their-own-stylesheets/136570/1 "2008-05-03T19:42:39Z")

</div>

I have a blog feature on part of my site which essentially is just a  
Posts and Comments controller. I was wondering if it’s possible to  
let users define or customize their own stylesheets for their blogs  
similar to how [tumblr.com](http://tumblr.com) or [blogger.com](http://blogger.com). Anyone know how?

---

<div class="post-metadata">

**Author:** ![vince](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/b5e925/32.png) [@vince](https://www.ruby-forum.com/u/vince)\
**Post date:** [May 3, 2008, 8:51pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-let-users-define-customize-their-own-stylesheets/136570/2 "2008-05-03T20:51:27Z")

</div>

On Sat, May 3, 2008 at 1:42 PM, vince [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have a blog feature on part of my site which essentially is just a  
> Posts and Comments controller. I was wondering if it’s possible to  
> let users define or customize their own stylesheets for their blogs  
> similar to how [tumblr.com](http://tumblr.com) or [blogger.com](http://blogger.com). Anyone know how?

Sure. Of how depends on exactly what you want to do.

If you want to let users select from several pre-defined themes, you  
can define those themes as css stylesheets, and have the  
controllers/views (most likely in your layout views) include the  
selected stylesheet(s) needed to implement the selected theme. Typo  
does this.

If you want to actually let users customize individual css styles,  
then you might generate one or more html style tags in a template  
using information stored for the user in the database.

–  
Rick DeNatale

My blog on Ruby  
[http://talklikeaduck.denhaven2.com/](http://talklikeaduck.denhaven2.com/)
