class being inserted behind my back..!

55 views
Skip to first unread message

Edward Shave

unread,
Oct 10, 2015, 11:47:57 PM10/10/15
to web2py-users
I make a button including two classes, btn and btn-primary.
The button shows up OK but the text looks horrible.
Upon inspection I find an extra class (btn-default) has been included..!
What's up guys?


{{extend 'layout.html'}}
<button class="btn btn-primary">This text looks horrible</button>


Leonel Câmara

unread,
Oct 11, 2015, 4:51:16 AM10/11/15
to web2py-users
Are you getting this result via ajax?

Edward Shave

unread,
Oct 11, 2015, 4:58:01 AM10/11/15
to web2py-users
Nope, that's the whole thing running in a new simple application.
I did this so as to eliminate anything else in my code.

The controller is simply...

def index():
   
return dict()

DenesL

unread,
Oct 11, 2015, 9:23:45 AM10/11/15
to web2py-users
The btn-default class is added by web2py-bootstrap3.js via
$('button', target).addClass('btn btn-default');

The "horrible" part comes from this bit in bootstrap-theme.min.css
text-shadow: 0px 1px 0px white;

Denes

Edward Shave

unread,
Oct 11, 2015, 10:55:56 AM10/11/15
to web...@googlegroups.com
Thanks for that DenesL,

I already worked out why the font was messy and suspected web2py was adding the class but it's good that someone has confirmed the details.

I came across this problem when cutting and pasting a demo from bootstrap website so I assume their code is good.

Adding a class like that seems an odd thing to do, especially as there is no mention I can find in the documentation.

If we are stuck with this behaviour for some good reason, then maybe the text-shadow attribute could be amended at the same time as the class is added?



--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/KPkEDV9RgUY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Anthony

unread,
Oct 11, 2015, 12:13:04 PM10/11/15
to web2py-users
I submitted an issue here: https://github.com/web2py/web2py/issues/1083

I think maybe in the past, other styles used to completely override the btn-default styles, so this wasn't a problem -- but it's a problem now.

Anthony
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages