Toolbar.scss 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. /**
  2. * @class Ext.Toolbar
  3. */
  4. /**
  5. * @var {color}
  6. * Toolbar background-color
  7. */
  8. $toolbar-background-color: dynamic($background-color);
  9. /**
  10. * @var {string/list}
  11. * Toolbar background-gradient. Can be either the name of a gradient defined by
  12. * {@link Global_CSS#background-gradient} or a list of color stops.
  13. */
  14. $toolbar-background-gradient: dynamic(null);
  15. /**
  16. * @var {color}
  17. * Toolbar color
  18. */
  19. $toolbar-color: dynamic($color);
  20. /**
  21. * @var {number/list}
  22. * Toolbar border-width
  23. */
  24. $toolbar-border-width: dynamic(1px);
  25. /**
  26. * @var {string/list}
  27. * Toolbar border-style
  28. */
  29. $toolbar-border-style: dynamic(solid);
  30. /**
  31. * @var {color/list}
  32. * Toolbar border-color
  33. */
  34. $toolbar-border-color: dynamic($neutral-medium-dark-color);
  35. /**
  36. * @var {list}
  37. * Toolbar box-shadow
  38. */
  39. $toolbar-box-shadow: dynamic(null);
  40. /**
  41. * @var {string/number}
  42. * Toolbar font-weight
  43. */
  44. $toolbar-font-weight: dynamic($font-weight-bold);
  45. /**
  46. * @var {number}
  47. * Toolbar font-size
  48. */
  49. $toolbar-font-size: dynamic($font-size);
  50. /**
  51. * @var {number}
  52. * Toolbar font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  53. */
  54. $toolbar-font-size-big: dynamic($font-size-big);
  55. /**
  56. * @var {number}
  57. * Toolbar line-height
  58. */
  59. $toolbar-line-height: dynamic(16px);
  60. /**
  61. * @var {number}
  62. * Toolbar line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  63. */
  64. $toolbar-line-height-big: dynamic(null);
  65. /**
  66. * @var {string}
  67. * Toolbar font-family
  68. */
  69. $toolbar-font-family: dynamic($font-family);
  70. /**
  71. * @var {number/list}
  72. * Toolbar padding
  73. */
  74. $toolbar-padding: dynamic(6px 8px);
  75. /**
  76. * @var {number/list}
  77. * Toolbar padding in the {@link Global_CSS#$enable-big big} sizing scheme
  78. */
  79. $toolbar-padding-big: dynamic(6px 10px);
  80. /**
  81. * @var {number}
  82. * The space in between horizontally aligned Toolbar items
  83. */
  84. $toolbar-horizontal-spacing: dynamic(8px);
  85. /**
  86. * @var {number}
  87. * The space in between horizontally aligned Toolbar items in the
  88. * {@link Global_CSS#$enable-big big} sizing scheme
  89. */
  90. $toolbar-horizontal-spacing-big: dynamic(10px);
  91. /**
  92. * @var {number}
  93. * The space in between vertically aligned Toolbar items
  94. */
  95. $toolbar-vertical-spacing: dynamic(6px);
  96. /**
  97. * @var {number}
  98. * The space in between vertically aligned Toolbar items in the
  99. * {@link Global_CSS#$enable-big big} sizing scheme
  100. */
  101. $toolbar-vertical-spacing-big: dynamic(8px);
  102. /**
  103. * @var {color}
  104. * Toolbar {@link Ext.Title Title} color
  105. */
  106. $toolbar-title-color: dynamic($highlight-color);
  107. /**
  108. * @var {string/number}
  109. * Toolbar {@link Ext.Title Title} font-weight
  110. */
  111. $toolbar-title-font-weight: dynamic($toolbar-font-weight);
  112. /**
  113. * @var {number}
  114. * Toolbar {@link Ext.Title Title} font-size
  115. */
  116. $toolbar-title-font-size: dynamic($toolbar-font-size);
  117. /**
  118. * @var {number}
  119. * Toolbar {@link Ext.Title Title} font-size in the
  120. * {@link Global_CSS#$enable-big big} sizing scheme
  121. */
  122. $toolbar-title-font-size-big: dynamic($toolbar-font-size-big);
  123. /**
  124. * @var {string}
  125. * Toolbar {@link Ext.Title Title} font-family
  126. */
  127. $toolbar-title-font-family: dynamic($font-family);
  128. /**
  129. * @var {number}
  130. * Toolbar {@link Ext.Title Title} title-padding
  131. */
  132. $toolbar-title-padding: dynamic(null);
  133. /**
  134. * @var {number}
  135. * Toolbar {@link Ext.Title Title} title-padding in the
  136. * {@link Global_CSS#$enable-big big} sizing scheme
  137. */
  138. $toolbar-title-padding-big: dynamic(null);
  139. /**
  140. * @var {number}
  141. * Toolbar min-height
  142. */
  143. $toolbar-min-height: dynamic(36px);
  144. /**
  145. * @var {number}
  146. * Toolbar min-height in the {@link Global_CSS#$enable-big big} sizing scheme
  147. */
  148. $toolbar-min-height-big: dynamic(44px);
  149. /**
  150. * @var {map}
  151. * Parameters for the "footer" toolbar UI.
  152. * Set to `null` to eliminate the UI from the CSS output.
  153. */
  154. $toolbar-footer-ui: dynamic((
  155. background-color: mix($base-light-color, $neutral-light-color, 30%)
  156. ));
  157. /**
  158. * Creates a visual theme for a Toolbar.
  159. *
  160. * @param {string} $ui
  161. * The name of the UI being created. Can not included spaces or special punctuation
  162. * (used in CSS class names).
  163. *
  164. * @param {String} [$xtype=toolbar] (protected) The {@link Ext.Class#xtype} to use
  165. * in CSS selectors. For use by UI mixins of derived classes.
  166. *
  167. * @param {color} $background-color
  168. * Toolbar background-color
  169. *
  170. * @param {string/list} $background-gradient
  171. * Toolbar background-gradient. Can be either the name of a gradient defined by
  172. * {@link Global_CSS#background-gradient} or a list of color stops.
  173. *
  174. * @param {color} $color
  175. * Toolbar color
  176. *
  177. * @param {number/list} $border-width
  178. * Toolbar border-width
  179. *
  180. * @param {string/list} $border-style
  181. * Toolbar border-style
  182. *
  183. * @param {color} $border-color
  184. * Toolbar border-color
  185. *
  186. * @param {color} $box-shadow
  187. * Toolbar box-shadow
  188. *
  189. * @param {string/number} $font-weight
  190. * Toolbar font-weight
  191. *
  192. * @param {number} $font-size
  193. * Toolbar font-size
  194. *
  195. * @param {number} $font-size-big
  196. * Toolbar font-size in the {@link Global_CSS#$enable-big big} sizing scheme
  197. *
  198. * @param {number} $line-height
  199. * Toolbar line-height
  200. *
  201. * @param {number} $line-height-big
  202. * Toolbar line-height in the {@link Global_CSS#$enable-big big} sizing scheme
  203. *
  204. * @param {string} $font-family
  205. * Toolbar font-family
  206. *
  207. * @param {number/list} $padding
  208. * Toolbar padding
  209. *
  210. * @param {number/list} $padding-big
  211. * Toolbar padding in the {@link Global_CSS#$enable-big big} sizing scheme
  212. *
  213. * @param {number} $horizontal-spacing
  214. * The space in between horizontally aligned Toolbar items
  215. *
  216. * @param {number} $horizontal-spacing-big
  217. * The space in between horizontally aligned Toolbar items in the
  218. * {@link Global_CSS#$enable-big big} sizing scheme
  219. *
  220. * @param {number} $vertical-spacing
  221. * The space in between vertically aligned Toolbar items
  222. *
  223. * @param {number} $vertical-spacing-big
  224. * The space in between vertically aligned Toolbar items in the
  225. * {@link Global_CSS#$enable-big big} sizing scheme
  226. *
  227. * @param {color} $title-color
  228. * Toolbar {@link Ext.Title Title} color
  229. *
  230. * @param {string/number} $title-font-weight
  231. * Toolbar {@link Ext.Title Title} font-weight
  232. *
  233. * @param {number} $title-font-size
  234. * Toolbar {@link Ext.Title Title} font-size
  235. *
  236. * @param {number} $title-font-size-big
  237. * Toolbar {@link Ext.Title Title} font-size in the
  238. * {@link Global_CSS#$enable-big big} sizing scheme
  239. *
  240. * @param {number} $title-padding
  241. * Toolbar {@link Ext.Title Title} padding
  242. *
  243. * @param {number} $title-padding-big
  244. * Toolbar {@link Ext.Title Title} padding in the
  245. * {@link Global_CSS#$enable-big big} sizing scheme
  246. *
  247. * @param {string} $title-font-family
  248. * Toolbar {@link Ext.Title Title} font-family
  249. *
  250. * @param {number} $min-height
  251. * Toolbar min-height
  252. *
  253. * @param {number} $min-height-big
  254. * Toolbar min-height in the {@link Global_CSS#$enable-big big} sizing scheme
  255. */
  256. @mixin toolbar-ui(
  257. $ui: null,
  258. $xtype: toolbar,
  259. $background-color: null,
  260. $background-gradient: null,
  261. $color: null,
  262. $border-width: null,
  263. $border-style: null,
  264. $border-color: null,
  265. $box-shadow: null,
  266. $font-weight: null,
  267. $font-size: null,
  268. $font-size-big: null,
  269. $line-height: null,
  270. $line-height-big: null,
  271. $font-family: null,
  272. $padding: null,
  273. $padding-big: null,
  274. $horizontal-spacing: null,
  275. $horizontal-spacing-big: null,
  276. $vertical-spacing: null,
  277. $vertical-spacing-big: null,
  278. $title-color: null,
  279. $title-font-weight: null,
  280. $title-font-size: null,
  281. $title-font-size-big: null,
  282. $title-padding: null,
  283. $title-padding-big: null,
  284. $title-font-family: null,
  285. $min-height: null,
  286. $min-height-big: null
  287. ) {
  288. $ui-suffix: ui-suffix($ui);
  289. @if $background-color != null {
  290. @if $border-color == null {
  291. $border-color: toolbar-border-color($background-color);
  292. }
  293. @if $title-color == null {
  294. $title-color: toolbar-title-color($background-color);
  295. }
  296. }
  297. .#{$prefix}#{$xtype}#{$ui-suffix} {
  298. @include background-gradient($background-color, $background-gradient);
  299. @include border($border-width, $border-style, $border-color);
  300. @include font($font-weight, $font-size, $line-height, $font-family);
  301. color: $color;
  302. box-shadow: $box-shadow;
  303. @if $enable-big {
  304. .#{$prefix}big & {
  305. font-size: $font-size-big;
  306. line-height: $line-height-big;
  307. }
  308. }
  309. .#{$prefix}title {
  310. color: $title-color;
  311. padding: $title-padding;
  312. @include font(
  313. $font-weight: $title-font-weight,
  314. $font-size: $title-font-size,
  315. $font-family: $title-font-family
  316. );
  317. @if $enable-big {
  318. .#{$prefix}big & {
  319. font-size: $title-font-size-big;
  320. padding: $title-padding-big;
  321. }
  322. }
  323. }
  324. }
  325. .#{$prefix}#{$xtype}#{$ui-suffix}-body-el {
  326. padding: $padding;
  327. min-height: $min-height;
  328. @if $enable-big {
  329. .#{$prefix}big & {
  330. padding: $padding-big;
  331. min-height: $min-height-big;
  332. }
  333. }
  334. @if $horizontal-spacing != null {
  335. &.#{$prefix}horizontal > .#{$prefix}component {
  336. margin-right: $horizontal-spacing;
  337. @if $enable-big {
  338. .#{$prefix}big & {
  339. margin-right: $horizontal-spacing-big;
  340. }
  341. }
  342. &:last-child {
  343. margin-right: 0;
  344. }
  345. }
  346. }
  347. @if $vertical-spacing != null {
  348. &.#{$prefix}vertical > .#{$prefix}component {
  349. margin-bottom: $vertical-spacing;
  350. @if $enable-big {
  351. .#{$prefix}big & {
  352. margin-bottom: $vertical-spacing-big;
  353. }
  354. }
  355. &:last-child {
  356. margin-bottom: 0;
  357. }
  358. }
  359. }
  360. }
  361. }
  362. /**
  363. * Creates a theme UI for toolbars.
  364. *
  365. * // SCSS
  366. * @include sencha-toolbar-ui('sub', #58710D, 'glossy');
  367. *
  368. * // JS
  369. * var myTb = new Ext.Toolbar({title: 'My Green Glossy Toolbar', ui: 'sub'})
  370. *
  371. * @param {string} $ui-label The name of the UI being created.
  372. * Can not included spaces or special punctuation (used in class names)
  373. * @param {color} $color Base color for the UI.
  374. * @param {string} [$gradient=$toolbar-background-gradient] Background gradient style for the UI.
  375. *
  376. * @member Ext.Button
  377. * @deprecated 6.0 Use {@link #toolbar-ui} instead
  378. */
  379. @mixin sencha-toolbar-ui(
  380. $ui-label,
  381. $color,
  382. $gradient: $toolbar-background-gradient
  383. ) {
  384. @include toolbar-ui(
  385. $ui: $ui-label,
  386. $background-color: $color,
  387. $background-gradient: $gradient
  388. );
  389. }