Overriding bootstrap's variables with dotless

1,215 views
Skip to first unread message

cara...@gmail.com

unread,
May 24, 2012, 5:39:24 PM5/24/12
to dot...@googlegroups.com
Hi there

I'm trying to override variables declared in twitter's bootstrap and compile it to css, but without success.

Original less:
@import "bootstrap-overrides.less";
@import "./Tools/twitter-bootstrap-v203/less/bootstrap.less";
@import "./Tools/twitter-bootstrap-v203/less/responsive.less";

Content of bootrap-overrides.less:
@baseFontSize:          18px;

But the value declared in variables.less (included in bootstrap.less) aren't overridden. I've tried to play with overriding, tried many options, but it doesn't work.

Compiling css from command line.

Any ideas? How can I override a variable with dotless? Is it possible/supported?

Thanks!

Luke Page

unread,
May 25, 2012, 2:19:22 PM5/25/12
to dot...@googlegroups.com

You need to override the variable after bootstrap defines it..

Does less.js do things differently?

If it doesn't I can only see 3 possible solutions, first waiting for import once, changing all bootstraps imports to import once, then importing variables, followed by your override. If you are lucky bootstrap will change to import-once when 1.3.1 of less.js is used. Secondly make a plugin that can redefine variables.

Thirdly fork bootstrap and keep track of your changes and use that.

--
You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.
To view this discussion on the web visit https://groups.google.com/d/msg/dotless/-/f75wHK3xEnoJ.
To post to this group, send email to dot...@googlegroups.com.
To unsubscribe from this group, send email to dotless+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dotless?hl=en.

Valeriu Caraulean

unread,
May 25, 2012, 5:44:18 PM5/25/12
to dot...@googlegroups.com
Thanks, Luke

I've already took the third option as the most straightforward one and that's less likely to bring surprises...

Cheers

Daniel Hölbling

unread,
May 25, 2012, 6:57:54 PM5/25/12
to dot...@googlegroups.com
I also think that's the recommendet one by bootstrap. At least I remember them allowing you to change their variables on the site in case you want less packaged. 

Greetings Daniel

tope

unread,
May 27, 2012, 7:44:53 PM5/27/12
to DotLess (Less Css for .NET)
Are overriding your overrides? It looks like you import your
overrides.less file first, and then you import the bootstrap files,
effectively overriding your first import...

Valeriu Caraulean

unread,
May 28, 2012, 4:36:19 PM5/28/12
to dot...@googlegroups.com
After failing to make it work I've been trying even dumb things, that's one of those :)

Cheers

--
You received this message because you are subscribed to the Google Groups "DotLess (Less Css for .NET)" group.

Nick Daniels

unread,
May 29, 2012, 11:06:37 AM5/29/12
to dot...@googlegroups.com
The correct way to override Bootstrap variables is to actually modify variables.less.
Cheers

To unsubscribe from this group, send email to dotless+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages