0

I am using Kendo UI with ASP MVC3 to build some forms. I am using the dropdown and datepicker widgets, which are styled larger that standard inputs. To ensure standard textboxes will match, Kendo has provided the .k-textbox class, which when assigned to a textbox, will style it to match the widgets.

I have created a template that does the job but is requiring a little extra coding to handle some conflicts, no biggie. However, I was wondering if there was a way to make an attribute selector (eg: input[type="text"]) inherit the style from another styled class. So could I make input[type=:text"] use the same styles as .k-textbox, without copying all the class data over?

DanMan
  • 10,986
  • 4
  • 38
  • 58
BattlFrog
  • 3,190
  • 8
  • 53
  • 84

1 Answers1

0

You could add your selector to the existing one, separated by a comma:

.k-textbox, input[type="text"] {
   /* classes already written by Kendo */
}

but then you won't be able to easily update this CSS when Kendo updates it.

FelipeAls
  • 20,995
  • 8
  • 51
  • 74
  • Unfortunately kendo has the styles for k-textbox spread over 17 or so different places. – BattlFrog Jun 12 '13 at 17:54
  • 30 occurences in my copy of commons.min.css, yep :/ Still possible with regexp at least in Sublime Text but a bit complicated (you've to capture what is between k-textbox and the next comma and add it to your selector too...) – FelipeAls Jun 12 '13 at 18:35