Toolable.scss 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /**
  2. * @class Ext.mixin.Toolable
  3. */
  4. /**
  5. * Toolable components need special handling for their padding. When there are no tools
  6. * (which usually means no dock wrapper) the padding on all sides is placed on the body-el,
  7. * However, when the component has tools, the horizontal padding needs to be removed
  8. * from the body-el and placed on the innermost dock wrapper so that the horizontal padding
  9. * is between the outermost tools and the left/right edges of the component. In this
  10. * configuration the space between the body and the tools is provided by the tools
  11. * themselves via $tool-spacing.
  12. *
  13. * The vertical padding remains on the body-el so that the height of the toolable component
  14. * when auto-heighted is determined by the body-el's line-height + padding + the element
  15. * borders. The tools gain an additional advantage from this arrangement because it means
  16. * they can be taller than the component's line-height and not cause the component's height
  17. * to increase since they are not "inside" of the vertical padding.
  18. * @private
  19. */
  20. @mixin toolable-ui(
  21. $ui: null,
  22. $xtype: null,
  23. $padding: null,
  24. $padding-big: null,
  25. $anchor: body-el
  26. ) {
  27. $ui-suffix: ui-suffix($ui);
  28. .#{$prefix}#{$xtype}#{$ui-suffix}-#{$anchor} {
  29. padding: $padding;
  30. @if $enable-big {
  31. .#{$prefix}big & {
  32. padding: $padding-big;
  33. }
  34. }
  35. }
  36. .#{$prefix}#{$xtype}#{$ui-suffix}-tool-dock {
  37. padding: box(0 right($padding) 0 left($padding));
  38. @if $enable-big {
  39. .#{$prefix}big & {
  40. padding: box(0 right($padding-big) 0 left($padding-big));
  41. }
  42. }
  43. > .#{$prefix}#{$anchor} {
  44. padding: box(top($padding) 0 bottom($padding) 0);
  45. @if $enable-big {
  46. .#{$prefix}big & {
  47. padding: box(top($padding-big) 0 bottom($padding-big) 0);
  48. }
  49. }
  50. }
  51. }
  52. }