rulebox.scss 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. // rulebox module skeleton for loading
  2. .rulebox:not([class*="rulebox-"]) {
  3. .editable:empty {
  4. background-color: $grey-color-light;
  5. }
  6. h1 {
  7. max-width: 45%;
  8. }
  9. p {
  10. min-height: 3em;
  11. }
  12. .rulebuilder_input {
  13. $padding: 10px;
  14. $height: 38px;
  15. $widths: 80px, 78px, 140px, 90px, 200px, 130px;
  16. $position: $padding;
  17. $bg-img: null;
  18. $bg-size: null;
  19. $bg-pos: null;
  20. @for $i from 1 through length($widths) {
  21. $bg-img: $bg-img linear-gradient(white $height, transparent 0)#{if($i != length($widths), ',', '')};
  22. $bg-size: $bg-size nth($widths, $i) $height#{if($i != length($widths), ',', '')};
  23. $bg-pos: $bg-pos $position $padding#{if($i != length($widths), ',', '')};
  24. $position: $position + nth($widths, $i) + $padding;
  25. }
  26. background-color: $grey-color-light;
  27. background-image: $bg-img;
  28. background-size: $bg-size;
  29. background-position: $bg-pos;
  30. background-repeat: no-repeat;
  31. height: $height + $padding * 2;
  32. }
  33. .rulebuilder_list {
  34. background-color: $grey-color-light;
  35. min-height: 9em;
  36. max-width: 90%;
  37. }
  38. }
  39. // Styles for the rulebox module
  40. .rulebox {
  41. border: 1px solid $grey-color-light;
  42. padding: 20px;
  43. margin: 20px 0 30px 0;
  44. .prompt,
  45. .module-type-header {
  46. color: $grey-color-dark;
  47. font-family: $header-font-family;
  48. font-weight: bold;
  49. }
  50. .module-questions {
  51. color: $grey-color;
  52. font-size: .8em;
  53. }
  54. .module-type {
  55. margin-bottom: $spacing-unit/2;
  56. }
  57. .prompt,
  58. .delete-module,
  59. .rulebuilder_modules,
  60. .linkbox_input,
  61. .metadata_input {
  62. display: none;
  63. }
  64. .editable, input.editable { /* All editable fields */
  65. padding: 10px;
  66. min-height: 1.5em;
  67. border: none;
  68. }
  69. .editable[contenteditable="false"] { /* inactive editable fields */
  70. border: none;
  71. }
  72. // TODO: module display is set within the spreadsheet
  73. .rulebuilder_input .module .delete-module {
  74. display: none !important;
  75. }
  76. .rulebuilder {}
  77. .rulebuilder_input {
  78. overflow: hidden;
  79. margin: 0 0 $spacing-unit;
  80. text-align: left;
  81. min-height: 1.5em;
  82. .prompt {
  83. color: $text-color;
  84. }
  85. .module .module-info {
  86. display: none;
  87. }
  88. }
  89. .rulebuilder_list {}
  90. .rulebuilder_modules {
  91. .module .delete-module {
  92. display: none;
  93. }
  94. }
  95. .metadata_input,
  96. .metadata_display {
  97. border: 1px solid $grey-color-light;
  98. background-color: white;
  99. margin: $spacing-unit 0 15px 0;
  100. padding: 10px;
  101. }
  102. .metadata_display {
  103. border-radius: 6px;
  104. text-align: center;
  105. }
  106. .metadata_input {
  107. input {
  108. margin-bottom: $spacing-unit / 2;
  109. }
  110. }
  111. &.rulebox-preview {
  112. // this class is toggled by toggleEditMode() in rule-scrips.html
  113. // when preview/customize button is pressed
  114. }
  115. &.rulebox-edit {
  116. // this class is toggled by toggleEditMode() in rule-scrips.html
  117. // when preview/customize button is pressed
  118. .prompt,
  119. .delete-module,
  120. .rulebuilder_modules,
  121. .metadata_input {
  122. display: block;
  123. }
  124. .linkbox_input {
  125. display: inline;
  126. }
  127. .editable[contenteditable="true"] { /* active editable fields */
  128. border-bottom: 1px dashed $grey-color-dark;
  129. }
  130. .metadata_display {
  131. display: none;
  132. }
  133. .prompt .module {
  134. margin: 0;
  135. &:hover,
  136. &:active {
  137. border-color: inherit;
  138. cursor: default;
  139. }
  140. }
  141. .module:hover {
  142. cursor: grab;
  143. border-color: $grey-color-dark;
  144. .module-logo {
  145. cursor: pointer;
  146. }
  147. }
  148. .module:active {
  149. cursor: grabbing;
  150. border-color: $brand-yellow;
  151. }
  152. .rulebuilder_input .module .delete-module {
  153. display: inline !important;
  154. }
  155. .module.module-custom {
  156. input {
  157. border-width: 0 0 1px 0;
  158. border-bottom: 1px dashed $grey-color-dark;
  159. font-family: inherit;
  160. font-size: inherit;
  161. padding: 5px;
  162. }
  163. }
  164. .rulebuilder {}
  165. .rulebuilder_input {
  166. &.drag-target {
  167. background-color: $brand-yellow;
  168. border-style: solid;
  169. }
  170. border: 4px dashed $brand-yellow;
  171. color: $text-color;
  172. padding: 10px 10px 10px 10px;
  173. }
  174. }
  175. }