Tip.scss 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. /**
  2. * @class Ext.tip.Tip
  3. */
  4. /**
  5. * @var {number}
  6. * The height (in all orientations) of the anchor pointer in pixels
  7. */
  8. $tip-anchor-height: dynamic(6px);
  9. /**
  10. * @var {number}
  11. * The width (in all orientations) of the anchor pointer in pixels
  12. */
  13. $tip-anchor-width: dynamic($tip-anchor-height * 2);
  14. /**
  15. * @var {color}
  16. * The background-color of the Tip
  17. */
  18. $tip-background-color: dynamic(#fff);
  19. /**
  20. * @var {string/list}
  21. * The background-gradient of the Tip. Can be either the name of a predefined gradient or a
  22. * list of color stops. Used as the `$type` parameter for {@link Global_CSS#background-gradient}.
  23. */
  24. $tip-background-gradient: dynamic('none');
  25. /**
  26. * @var {color}
  27. * The text color of the Tip body
  28. */
  29. $tip-body-color: dynamic(#000);
  30. /**
  31. * @var {number}
  32. * The font-size of the Tip body
  33. */
  34. $tip-body-font-size: dynamic($font-size);
  35. /**
  36. * @var {string}
  37. * The font-weight of the Tip body
  38. */
  39. $tip-body-font-weight: dynamic($font-weight);
  40. /**
  41. * @var {number/list}
  42. * The padding of the Tip body
  43. */
  44. $tip-body-padding: dynamic(3px);
  45. /**
  46. * @var {color}
  47. * The text color of any anchor tags inside the Tip body
  48. */
  49. $tip-body-link-color: dynamic($tip-body-color);
  50. /**
  51. * @var {color}
  52. * The text color of the Tip header
  53. */
  54. $tip-header-color: dynamic($tip-body-color);
  55. /**
  56. * @var {number}
  57. * The font-size of the Tip header
  58. */
  59. $tip-header-font-size: dynamic($tip-body-font-size);
  60. /**
  61. * @var {string}
  62. * The font-weight of the Tip header
  63. */
  64. $tip-header-font-weight: dynamic(bold);
  65. // private - for 4.x compat
  66. $tip-header-body-padding: dynamic(3px 3px 0 3px);
  67. /**
  68. * @var {number/list}
  69. * The padding of the Tip header's body element
  70. */
  71. $tip-header-padding: dynamic($tip-header-body-padding);
  72. /**
  73. * @var {color}
  74. * The border-color of the Tip
  75. */
  76. $tip-border-color: dynamic($panel-border-color);
  77. /**
  78. * @var {number}
  79. * The border-width of the Tip
  80. */
  81. $tip-border-width: dynamic(1px);
  82. /**
  83. * @var {number}
  84. * The border-radius of the Tip
  85. */
  86. $tip-border-radius: dynamic(3px);
  87. /**
  88. * @var {color}
  89. * The inner border-color of the form field error Tip
  90. */
  91. $tip-error-inner-border-color: dynamic(#fff);
  92. /**
  93. * @var {number}
  94. * The inner border-width of the form field error Tip
  95. */
  96. $tip-error-inner-border-width: dynamic(0);
  97. /**
  98. * @var {color}
  99. * The border-color of the form field error Tip
  100. */
  101. $tip-error-border-color: dynamic($tip-border-color);
  102. /**
  103. * @var {number}
  104. * The border-radius of the form field error Tip
  105. */
  106. $tip-error-border-radius: dynamic($tip-border-radius);
  107. /**
  108. * @var {number}
  109. * The border-width of the form field error Tip
  110. */
  111. $tip-error-border-width: dynamic($tip-border-width);
  112. /**
  113. * @var {color}
  114. * The background-color of the form field error Tip
  115. */
  116. $tip-error-background-color: dynamic($tip-background-color);
  117. /**
  118. * @var {number/list}
  119. * The padding of the form field error Tip's body element
  120. */
  121. $tip-error-body-padding: dynamic($tip-body-padding);
  122. /**
  123. * @var {color}
  124. * The text color of the form field error Tip's body element
  125. */
  126. $tip-error-body-color: dynamic($tip-body-color);
  127. /**
  128. * @var {number}
  129. * The font-size of the form field error Tip's body element
  130. */
  131. $tip-error-body-font-size: dynamic($tip-body-font-size);
  132. /**
  133. * @var {string}
  134. * The font-weight of the form field error Tip's body element
  135. */
  136. $tip-error-body-font-weight: dynamic($tip-body-font-weight);
  137. /**
  138. * @var {color}
  139. * The color of anchor tags in the form field error Tip's body element
  140. */
  141. $tip-error-body-link-color: dynamic($tip-body-link-color);
  142. /**
  143. * @var {number}
  144. * The space between {@link Ext.panel.Tool Tools} in the header
  145. */
  146. $tip-tool-spacing: dynamic(4px);
  147. /**
  148. * @var {string}
  149. * The sprite to use for the header {@link Ext.panel.Tool Tools}
  150. */
  151. $tip-tool-background-image: dynamic('tools/tool-sprites');
  152. /**
  153. * @var {boolean}
  154. * True to include the "default" tip UI
  155. */
  156. $include-tip-default-ui: dynamic($include-default-uis);
  157. /**
  158. * @var {boolean}
  159. * True to include the "form-invalid" tip UI
  160. */
  161. $include-tip-form-invalid-ui: dynamic($include-default-uis);
  162. /**
  163. * Creates a visual theme for a Ext.tip.Tip
  164. *
  165. * @param {string} $ui
  166. * The name of the UI being created. Can not included spaces or special punctuation
  167. * (used in CSS class names).
  168. *
  169. * @param {color} [$ui-border-color=$tip-border-color]
  170. * The border-color of the Tip
  171. *
  172. * @param {number} [$ui-border-width=$tip-border-width]
  173. * The border-width of the Tip
  174. *
  175. * @param {number} [$ui-border-radius=$tip-border-radius]
  176. * The border-radius of the Tip
  177. *
  178. * @param {color} [$ui-background-color=$tip-background-color]
  179. * The background-color of the Tip
  180. *
  181. * @param {string/list} [$ui-background-gradient=$tip-background-gradient]
  182. * The background-gradient of the Tip. Can be either the name of a predefined gradient or a
  183. * list of color stops. Used as the `$type` parameter for {@link Global_CSS#background-gradient}.
  184. *
  185. * @param {number} [$ui-tool-spacing=$tip-tool-spacing]
  186. * The space between {@link Ext.panel.Tool Tools} in the header
  187. *
  188. * @param {string} [$ui-tool-background-image=$tip-tool-background-image]
  189. * The sprite to use for the header {@link Ext.panel.Tool Tools}
  190. *
  191. * @param {number/list} [$ui-header-padding=$tip-header-padding]
  192. * The padding of the Tip header's body element
  193. *
  194. * @param {color} [$ui-header-color=$tip-header-color]
  195. * The text color of the Tip header
  196. *
  197. * @param {number} [$ui-header-font-size=$tip-header-font-size]
  198. * The font-size of the Tip header
  199. *
  200. * @param {string} [$ui-header-font-weight=$tip-header-font-weight]
  201. * The font-weight of the Tip header
  202. *
  203. * @param {number/list} [$ui-body-padding=$tip-body-padding]
  204. * The padding of the Tip body
  205. *
  206. * @param {color} [$ui-body-color=$tip-body-color]
  207. * The text color of the Tip body
  208. *
  209. * @param {number} [$ui-body-font-size=$tip-body-font-size]
  210. * The font-size of the Tip body
  211. *
  212. * @param {string} [$ui-body-font-weight=$tip-body-font-weight]
  213. * The font-weight of the Tip body
  214. *
  215. * @param {color} [$ui-body-link-color=$tip-body-link-color]
  216. * The text color of any anchor tags inside the Tip body
  217. *
  218. * @param {number} [$ui-inner-border-width=0]
  219. * The inner border-width of the Tip
  220. *
  221. * @param {color} [$ui-inner-border-color=#fff]
  222. * The inner border-color of the Tip
  223. *
  224. * @param {number} [$ui-tip-anchor-height=$tip-anchor-height]
  225. * The height (in all orientations) of the anchor triangle.
  226. *
  227. * @param {number} [$ui-tip-anchor-width=$tip-anchor-width]
  228. * The width (in all orientations) of the anchor triangle.
  229. *
  230. * @param {string} $ui-label
  231. * This is deprecated, please use $ui instead.
  232. *
  233. * @member Ext.tip.Tip
  234. */
  235. @mixin extjs-tip-ui(
  236. $ui: null,
  237. $ui-border-color: $tip-border-color,
  238. $ui-border-width: $tip-border-width,
  239. $ui-border-radius: $tip-border-radius,
  240. $ui-background-color: $tip-background-color,
  241. $ui-background-gradient: $tip-background-gradient,
  242. $ui-tool-spacing: $tip-tool-spacing,
  243. $ui-tool-background-image: $tip-tool-background-image,
  244. $ui-header-padding: $tip-header-padding,
  245. $ui-header-color: $tip-header-color,
  246. $ui-header-font-size: $tip-header-font-size,
  247. $ui-header-font-weight: $tip-header-font-weight,
  248. $ui-body-padding: $tip-body-padding,
  249. $ui-body-color: $tip-body-color,
  250. $ui-body-font-size: $tip-body-font-size,
  251. $ui-body-font-weight: $tip-body-font-weight,
  252. $ui-body-link-color: $tip-body-link-color,
  253. $ui-inner-border-width: 0,
  254. $ui-inner-border-color: #fff,
  255. $ui-tip-anchor-height: $tip-anchor-height,
  256. $ui-tip-anchor-width: $tip-anchor-width,
  257. // deprecated - use $ui instead
  258. $ui-label: null
  259. ) {
  260. @if $ui == null {
  261. @if $ui-label != null {
  262. @warn '$ui-label is deprecated. Use $ui instead';
  263. $ui: $ui-label;
  264. } @else {
  265. @warn "#{error('$ui is required')}";
  266. }
  267. }
  268. @if not is-null($ui-border-radius) and $ui-border-radius != 0 {
  269. @include x-frame(
  270. $cls: 'tip',
  271. $ui: '#{$ui}',
  272. $border-radius: $ui-border-radius,
  273. $border-width: $ui-border-width,
  274. $background-color: $ui-background-color,
  275. $background-gradient: $ui-background-gradient,
  276. $table: true
  277. );
  278. }
  279. .#{$prefix}tip-#{$ui} {
  280. background-color: $ui-background-color;
  281. border-color: $ui-border-color;
  282. @if $ui-inner-border-width != 0 {
  283. @include inner-border(
  284. $width: $ui-inner-border-width,
  285. $color: $ui-inner-border-color
  286. );
  287. }
  288. .#{$prefix}tool-img {
  289. @if $ui-tool-background-image != $tool-background-image {
  290. background-image: theme-background-image($ui-tool-background-image);
  291. }
  292. @if is-null($ui-background-gradient) {
  293. // EXTJSIV-8846: partially transparent png images do not display correctly
  294. // in winXP/IE8m when the image element has a transparent background.
  295. // to fix this, we give the element the same background-color as the tooltip.
  296. background-color: $ui-background-color;
  297. }
  298. }
  299. }
  300. $ui-tool-margin: 0 0 0 $ui-tool-spacing;
  301. .#{$prefix}tip-header-#{$ui} {
  302. .#{$prefix}tool-after-title {
  303. margin: $ui-tool-margin;
  304. }
  305. @if $include-rtl {
  306. .#{$prefix}rtl.#{$prefix}tool-after-title {
  307. margin: rtl($ui-tool-margin);
  308. }
  309. }
  310. .#{$prefix}tool-before-title {
  311. margin: rtl($ui-tool-margin);
  312. }
  313. @if $include-rtl {
  314. .#{$prefix}rtl.#{$prefix}tool-before-title {
  315. margin: $ui-tool-margin;
  316. }
  317. }
  318. }
  319. .#{$prefix}tip-header-#{$ui} {
  320. padding: $ui-header-padding;
  321. }
  322. .#{$prefix}tip-header-title-#{$ui} {
  323. color: $ui-header-color;
  324. font-size: $ui-header-font-size;
  325. font-weight: $ui-header-font-weight;
  326. }
  327. .#{$prefix}tip-body-#{$ui} {
  328. padding: $ui-body-padding;
  329. color: $ui-body-color;
  330. font-size: $ui-body-font-size;
  331. font-weight: $ui-body-font-weight;
  332. a {
  333. color: $ui-body-link-color;
  334. }
  335. }
  336. .#{$prefix}tip-#{$ui} {
  337. $anchor-border-width: $ui-tip-anchor-width / 2;
  338. // The main anchor element.
  339. // The individual orientations will have one triangle as the border color
  340. .#{$prefix}tip-anchor {
  341. border: $anchor-border-width solid transparent;
  342. @if $include-ie {
  343. _border-color: pink;
  344. _filter: chroma(color=pink);
  345. }
  346. }
  347. @if $ui-background-color != $ui-border-color {
  348. // This is the overlaying triangle which has the $ui-background-color to create
  349. // the impression of the background continuing into the anchor.
  350. //
  351. // Only needed if the background color and border color are different
  352. .#{$prefix}tip-anchor:after {
  353. position: absolute;
  354. border: $anchor-border-width solid transparent;
  355. content: "";
  356. @if $include-ie {
  357. _border-color: pink;
  358. _filter: chroma(color=pink);
  359. }
  360. }
  361. .#{$prefix}tip-anchor-top {
  362. border-top-width: 0;
  363. border-bottom: $ui-tip-anchor-height solid darken($ui-border-color, 5%);
  364. top: -($ui-tip-anchor-height);
  365. }
  366. .#{$prefix}tip-anchor-bottom {
  367. border-bottom-width: 0;
  368. border-top: $ui-tip-anchor-height solid darken($ui-border-color, 5%);
  369. bottom: -($ui-tip-anchor-height);
  370. }
  371. .#{$prefix}tip-anchor-left {
  372. border-left-width: 0;
  373. border-right: $ui-tip-anchor-height solid darken($ui-border-color, 5%);
  374. left: -($ui-tip-anchor-height);
  375. }
  376. .#{$prefix}tip-anchor-right {
  377. border-right-width: 0;
  378. border-left: $ui-tip-anchor-height solid darken($ui-border-color, 5%);
  379. right: -($ui-tip-anchor-height);
  380. }
  381. .#{$prefix}tip-anchor-top:after {
  382. border-top-width: 0;
  383. border-bottom: $ui-tip-anchor-height solid $ui-background-color;
  384. top: $ui-border-width;
  385. margin-left: -$anchor-border-width;
  386. }
  387. .#{$prefix}tip-anchor-bottom:after {
  388. border-bottom-width: 0;
  389. border-top: $ui-tip-anchor-height solid $ui-background-color;
  390. bottom: $ui-border-width;
  391. margin-left: -$anchor-border-width;
  392. }
  393. .#{$prefix}tip-anchor-left:after {
  394. border-left-width: 0;
  395. border-right: $ui-tip-anchor-height solid $ui-background-color;
  396. left: $ui-border-width;
  397. margin-top: -$anchor-border-width;
  398. }
  399. .#{$prefix}tip-anchor-right:after {
  400. border-right-width: 0;
  401. border-left: $ui-tip-anchor-height solid $ui-background-color;
  402. right: $ui-border-width;
  403. margin-top: -$anchor-border-width;
  404. }
  405. } @else {
  406. .#{$prefix}tip-anchor-top {
  407. border-top-width: 0;
  408. border-bottom: $ui-tip-anchor-height solid $ui-border-color;
  409. top: -($ui-tip-anchor-height);
  410. }
  411. .#{$prefix}tip-anchor-bottom {
  412. border-bottom-width: 0;
  413. border-top: $ui-tip-anchor-height solid $ui-border-color;
  414. bottom: -($ui-tip-anchor-height);
  415. }
  416. .#{$prefix}tip-anchor-left {
  417. border-left-width: 0;
  418. border-right: $ui-tip-anchor-height solid $ui-border-color;
  419. left: -($ui-tip-anchor-height);
  420. }
  421. .#{$prefix}tip-anchor-right {
  422. border-right-width: 0;
  423. border-left: $ui-tip-anchor-height solid $ui-border-color;
  424. right: -($ui-tip-anchor-height);
  425. }
  426. }
  427. }
  428. }