toolbarmodifier.less 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. // Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
  2. // For licensing, see LICENSE.html or http://cksource.com/ckeditor/license
  3. @import "base.less";
  4. @modifier-group-hover-color: #fffbe3;
  5. @modifier-group-active-color: #f0fafb;
  6. @modifier-active-toolbar-color: darken( @modifier-group-hover-color, 10% );
  7. @modifier-toolbar-border-color: #ccc;
  8. @modifier-toolbar-group-border-color: #ddd;
  9. @modifier-toolbar-group-vpadding: 2px;
  10. @modifier-toolbar-hgap: 5px;
  11. @modifier-toolbar-button-color: #e7e7e7;
  12. #toolbar .cke_toolbar {
  13. pointer-events: none;
  14. .user-select( none );
  15. cursor: default;
  16. }
  17. // Dim all but active toolbars if some is active.
  18. .some-toolbar-active .cke_toolbar {
  19. .opacity( .5 );
  20. }
  21. .cke_toolbar.active {
  22. position: relative;
  23. // Active toolbar is always highlighted.
  24. .opacity( 1 );
  25. &:after {
  26. content: '';
  27. display: block;
  28. position: absolute;
  29. top: 0;
  30. right: 6px;
  31. bottom: 5px;
  32. left: 0;
  33. .border-radius( 5px );
  34. .box-shadow( 0px 0px 15px 3px @modifier-active-toolbar-color );
  35. }
  36. .cke_toolgroup {
  37. .box-shadow( none );
  38. border-color: darken( @modifier-active-toolbar-color, 40% );
  39. }
  40. .cke_combo,
  41. .cke_toolgroup {
  42. position: relative;
  43. z-index: 2;
  44. }
  45. .cke_combo_button {
  46. .box-shadow( none );
  47. }
  48. }
  49. .unselectable {
  50. .user-select( none );
  51. }
  52. .toolbar {
  53. padding: 5px 0;
  54. margin-bottom: 2 * @sample-standard-vgap;
  55. overflow: hidden;
  56. background: #fff;
  57. button.button-a {
  58. &.cke_button {
  59. cursor: pointer;
  60. display: inline-block;
  61. padding: 4px 6px;
  62. outline: 0;
  63. border: 1px solid #a6a6a6;
  64. }
  65. &.hidden {
  66. display: none;
  67. }
  68. &.left {
  69. float: left;
  70. margin-right: 8px;
  71. }
  72. &.right {
  73. float: right;
  74. margin-left: 8px;
  75. }
  76. .highlight {
  77. color: #ffefc1;
  78. }
  79. }
  80. }
  81. // Styles applied when configurator is hidden and code is being displayed (and vice-versa).
  82. .configContainer.hidden,
  83. .toolbarModifier.hidden,
  84. .toolbarModifier-hints.hidden {
  85. display: none;
  86. }
  87. .toolbarModifier :focus,
  88. .toolbar button:focus,
  89. .configContainer textarea.configCode:focus {
  90. outline: none;
  91. }
  92. div.toolbarModifier {
  93. padding: 0;
  94. overflow: hidden;
  95. width: 100%;
  96. position: relative;
  97. display: table;
  98. border-collapse: collapse;
  99. ::-moz-focus-inner {
  100. border: 0;
  101. }
  102. .empty {
  103. display: none;
  104. }
  105. &.empty-visible .empty {
  106. display: table-row;
  107. .opacity( 0.6 );
  108. }
  109. // Give empty toolbar groups height similar to height of non empty groups.
  110. // Non empty groups are stretched by contained toolbar buttons.
  111. .empty > p {
  112. line-height: 31px;
  113. }
  114. // List of toolbars.
  115. & > ul {
  116. padding: 0;
  117. margin: 0;
  118. border-top: 1px solid @modifier-toolbar-border-color;
  119. width: 100%;
  120. &[data-type="table-header"] {
  121. display: table-header-group;
  122. }
  123. &[data-type="table-body"] {
  124. display: table-row-group;
  125. }
  126. // Override global margins and paddings.
  127. p {
  128. padding: 0;
  129. margin: 0;
  130. }
  131. // A single toolbar.
  132. & > li {
  133. display: table-row;
  134. &[data-type="header"] {
  135. font-weight: bold;
  136. user-select: none;
  137. cursor: default;
  138. }
  139. &[data-type="group"],
  140. &[data-type="separator"] {
  141. border-bottom: 1px solid @modifier-toolbar-border-color;
  142. }
  143. &[data-type="subgroup"] {
  144. border-top: 1px solid #eee;
  145. &:first-child {
  146. border-top: none;
  147. }
  148. }
  149. &[data-type="group"].active,
  150. &[data-type="group"]:hover,
  151. &[data-type="separator"].active,
  152. &[data-type="separator"]:hover {
  153. overflow: hidden;
  154. z-index: 2;
  155. }
  156. &[data-type="group"].active,
  157. &[data-type="separator"].active,
  158. &[data-type="group"].active:hover,
  159. &[data-type="separator"].active:hover {
  160. background: @modifier-group-active-color;
  161. }
  162. &[data-type="group"]:hover,
  163. &[data-type="separator"]:hover {
  164. background: @modifier-group-hover-color;
  165. }
  166. &[data-type="separator"] {
  167. &:after {
  168. content: '';
  169. width: 100%;
  170. }
  171. background: #f5f5f5;
  172. & > p {
  173. padding: @modifier-toolbar-group-vpadding @modifier-toolbar-hgap;
  174. }
  175. }
  176. & > p, & > ul {
  177. display: table-cell;
  178. vertical-align: middle;
  179. }
  180. // Note: this also controls the list of toolbar groups.
  181. p {
  182. padding-left: @modifier-toolbar-hgap;
  183. min-width: 200px;
  184. span {
  185. white-space: nowrap;
  186. cursor: default;
  187. button {
  188. font-size: 12.666px;
  189. margin-right: 5px;
  190. cursor: pointer;
  191. background: #fff;
  192. .border-radius( 5px );
  193. border: 1px solid #bbb;
  194. padding: 0 7px;
  195. line-height: 12px;
  196. height: 20px;
  197. &:not(.disabled) {
  198. &:hover,
  199. &:focus {
  200. color: #fff;
  201. background-color: @sample-top-navigation-background;
  202. border-color: transparent;
  203. }
  204. }
  205. &.move.disabled {
  206. cursor: default;
  207. .opacity( 0.2 );
  208. }
  209. }
  210. }
  211. }
  212. // List of toolbar groups.
  213. ul {
  214. border-collapse: collapse;
  215. padding: 0;
  216. width: 100%;
  217. // A single toolbar group.
  218. li {
  219. display: table-row;
  220. list-style-type: none;
  221. // Resets slightly increased lists' lh which is bigger than button's height
  222. // so it stretches columns.
  223. line-height: 1;
  224. &[data-type="subgroup"] {
  225. border-top: 1px solid @modifier-toolbar-group-border-color;
  226. &:first-child {
  227. border-top: 0;
  228. }
  229. [data-type="button"] {
  230. .border-radius( 3px );
  231. padding: 0 2px;
  232. &:focus {
  233. background: rgba(0, 0, 0, 0.04);
  234. }
  235. input {
  236. vertical-align: middle;
  237. }
  238. }
  239. }
  240. & > p, & > ul {
  241. display: table-cell;
  242. vertical-align: middle;
  243. }
  244. // List of buttons in a group.
  245. ul {
  246. padding: 0;
  247. // A single button in a group.
  248. li {
  249. padding: 0;
  250. display: inline-block;
  251. cursor: pointer;
  252. margin: @modifier-toolbar-group-vpadding 5px @modifier-toolbar-group-vpadding 0;
  253. // Enforce styles to save space.
  254. .cke_combo_text {
  255. cursor: pointer;
  256. white-space: nowrap;
  257. }
  258. .cke_toolgroup,
  259. .cke_combo_button {
  260. cursor: pointer;
  261. margin: 0;
  262. vertical-align: middle;
  263. border: 1px solid #ddd;
  264. .font-size( .713 );
  265. }
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. & > .codemirror-wrapper {
  273. overflow-y: auto;
  274. }
  275. // Advanced configurator: list of unused elements.
  276. &-hints {
  277. float: right;
  278. width: 350px;
  279. min-width: 150px;
  280. overflow-y: auto;
  281. margin-left: @sample-standard-hgap;
  282. h3 {
  283. .font-size( 1.13 );
  284. padding: .3*@sample-standard-vgap @sample-standard-hgap;
  285. background: @sample-box-background-color;
  286. border-bottom: 1px solid @sample-box-border-color;
  287. margin-top: 0;
  288. margin-bottom: @sample-standard-vgap;
  289. }
  290. dl {
  291. //margin-top: 0;
  292. margin-bottom: @sample-standard-vgap;
  293. overflow: hidden;
  294. .list-header {
  295. font-weight: bold;
  296. border: 0;
  297. padding-bottom: .5*@sample-standard-vgap;
  298. }
  299. & > p {
  300. text-align: center;
  301. }
  302. dt {
  303. float: left;
  304. width: 9em;
  305. clear: both;
  306. text-align: right;
  307. border-top: 1px solid @sample-box-border-color;
  308. padding-left: @sample-standard-hgap;
  309. padding-right: .1em;
  310. .box-sizing( border-box );
  311. code {
  312. background: none;
  313. border: none;
  314. vertical-align: middle;
  315. }
  316. }
  317. dd {
  318. margin-left: 10em;
  319. clear: right;
  320. padding-right: @sample-standard-hgap;
  321. code {
  322. line-height: 2.2em;
  323. }
  324. &:after {
  325. content: '\00a0';
  326. display: block;
  327. clear: left;
  328. float: right;
  329. height: 0;
  330. width: 0;
  331. }
  332. }
  333. }
  334. }
  335. }
  336. .toolbarModifier-hints,
  337. .configContainer textarea.configCode,
  338. .CodeMirror {
  339. .border-radius( 3px );
  340. border: 1px solid #ccc;
  341. .font-size( .813 );
  342. }
  343. .configContainer textarea.configCode,
  344. .CodeMirror pre,
  345. .CodeMirror-linenumber {
  346. .font-size( .813 );
  347. font-family: @sample-font-stack-monospace;
  348. }
  349. .CodeMirror pre {
  350. border: none;
  351. padding: 0;
  352. margin: 0;
  353. }
  354. .configContainer textarea.configCode {
  355. .box-sizing( border-box );
  356. color: @sample-text-color;
  357. padding: 10px;
  358. width: 100%;
  359. min-height: 500px;
  360. margin: 0;
  361. resize: none;
  362. outline: none;
  363. -moz-tab-size: 4;
  364. tab-size: 4;
  365. white-space: pre;
  366. word-wrap: normal;
  367. overflow: auto;
  368. }
  369. .CodeMirror-hints.toolbar-modifier {
  370. padding: 0;
  371. color: @sample-text-color;
  372. .CodeMirror-hint-active {
  373. color: @sample-text-color;
  374. background: @modifier-group-active-color;
  375. }
  376. .font-size( .875 );
  377. font-family: @sample-font-stack-monospace;
  378. & > li:hover {
  379. background: @modifier-group-hover-color;
  380. }
  381. }
  382. /* Text modifier */
  383. #toolbarModifierWrapper {
  384. margin-bottom: @sample-standard-vgap;
  385. .invalid .CodeMirror {
  386. background: #fff8f8;
  387. border-color: red;
  388. }
  389. .CodeMirror {
  390. // Autogrow. http://codemirror.net/demo/resize.html
  391. height: auto;
  392. // Complementory with std's CodeMirror-lines vertical padding.
  393. // Not needed when we use lines number, but we can't due to a bug in CM.
  394. padding: 0 @sample-standard-vgap/2;
  395. }
  396. }
  397. .staticContainer {
  398. position: fixed;
  399. top: 0;
  400. width: 100%;
  401. z-index: 10;
  402. > .grid-container {
  403. max-width: 1044px + 2 * @grid-gutter-width;
  404. .inner {
  405. background: #fff;
  406. .toolbar {
  407. margin-bottom: 0;
  408. }
  409. }
  410. }
  411. }
  412. // Help button to display information about configurator.
  413. #help {
  414. position: relative;
  415. top: -15px;
  416. left: -5px;
  417. &-content {
  418. display: none;
  419. }
  420. }