jetpack-admin-jitm.scss 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. // Just in Time Messaging - message prompts
  2. @import '_inc/client/scss/functions/rem';
  3. @import '_inc/client/scss/variables/colors';
  4. @import '_inc/client/scss/mixins/breakpoints';
  5. @mixin clear-fix {
  6. &:after {
  7. content: ".";
  8. display: block;
  9. height: 0;
  10. clear: both;
  11. visibility: hidden;
  12. }
  13. }
  14. @mixin jitm-banner-color( $color ) {
  15. border-left-color: $color;
  16. .jitm-banner__icon {
  17. color: $color;
  18. }
  19. .jitm-banner__icon-circle {
  20. background-color: $color;
  21. }
  22. }
  23. // New JITMS - modified calypso banner styles
  24. .jitm-button {
  25. background: $white;
  26. border-color: lighten( $gray, 20% );
  27. border-style: solid;
  28. border-width: 1px 1px 2px;
  29. color: $gray-dark;
  30. cursor: pointer;
  31. display: inline-block;
  32. margin: 0;
  33. outline: 0;
  34. overflow: hidden;
  35. font-weight: 500;
  36. text-overflow: ellipsis;
  37. text-decoration: none;
  38. vertical-align: top;
  39. box-sizing: border-box;
  40. font-size: rem( 14px );
  41. line-height: rem( 21px );
  42. border-radius: rem( 4px );
  43. padding: rem( 7px ) rem( 14px ) rem( 9px );
  44. appearance: none;
  45. &:hover {
  46. border-color: lighten( $gray, 10% );
  47. color: $gray-dark;
  48. }
  49. &:active {
  50. border-width: 2px 1px 1px;
  51. }
  52. &:visited {
  53. color: $gray-dark;
  54. }
  55. &[disabled],
  56. &:disabled {
  57. color: lighten( $gray, 30% );
  58. background: $white;
  59. border-color: lighten( $gray, 30% );
  60. cursor: default;
  61. &:active {
  62. border-width: 1px 1px 2px;
  63. }
  64. }
  65. &:focus {
  66. outline: 0;
  67. border-color: $blue-medium;
  68. box-shadow: 0 0 0 2px $blue-light;
  69. }
  70. &.is-compact {
  71. padding: rem( 7px );
  72. color: darken( $gray, 10% );
  73. font-size: rem( 12px );
  74. line-height: 1;
  75. &:disabled {
  76. color: lighten( $gray, 30% );
  77. }
  78. }
  79. &.hidden {
  80. display: none;
  81. }
  82. }
  83. // Primary buttons
  84. .jitm-button.is-primary {
  85. background: $blue-medium;
  86. border-color: $blue-wordpress;
  87. color: $white;
  88. &:hover,
  89. &:focus {
  90. border-color: $blue-dark;
  91. color: $white;
  92. }
  93. &[disabled],
  94. &:disabled {
  95. background: tint( $blue-light, 50% );
  96. border-color: tint( $blue-wordpress, 55% );
  97. color: $white;
  98. }
  99. &.is-compact {
  100. color: $white;
  101. }
  102. }
  103. // if JITM appears directly below WordPress "help" menu adjust margins
  104. #screen-meta-links+.jitm-card {
  105. margin: rem( 40px ) 1.5385em 0 auto;
  106. }
  107. .jitm-card {
  108. display: block;
  109. position: relative;
  110. margin: rem( 16px ) 0 0 auto;
  111. padding: rem( 16px );
  112. box-sizing: border-box;
  113. background: $white;
  114. box-shadow: 0 0 0 1px transparentize( lighten( $gray, 20% ), .5 ),
  115. 0 1px 2px lighten( $gray, 30% );
  116. @include clear-fix;
  117. @include breakpoint( ">480px" ) {
  118. margin-bottom: rem( 16px );
  119. padding: rem( 24px );
  120. }
  121. // Compact Card
  122. &.is-compact {
  123. margin-bottom: rem( 1px );
  124. @include breakpoint( ">480px" ) {
  125. margin-bottom: 1px;
  126. padding: rem( 16px ) rem( 24px );
  127. }
  128. }
  129. &.is-card-link {
  130. padding-right: rem( 48px );
  131. }
  132. }
  133. // remove right margin for jitms in the editor
  134. .post-php .jitm-card {
  135. margin-right: 0;
  136. }
  137. .jitm-banner.jitm-card {
  138. border-left: 4px solid;
  139. display: flex;
  140. padding: rem( 12px ) rem( 6px ) rem( 12px ) rem( 12px );
  141. position: relative;
  142. z-index: 2;
  143. @include breakpoint( "<480px" ) {
  144. display: block;
  145. }
  146. &.is-card-link {
  147. padding: rem( 12px ) rem( 48px ) rem( 12px ) rem( 16px );
  148. }
  149. &.is-dismissible {
  150. padding-right: rem( 48px );
  151. }
  152. @include jitm-banner-color( $alert-green );
  153. &.is-upgrade-personal {
  154. @include jitm-banner-color( $alert-yellow );
  155. }
  156. &.is-upgrade-premium {
  157. @include jitm-banner-color( $alert-green );
  158. }
  159. &.is-upgrade-business,
  160. &.woo-jitm {
  161. @include jitm-banner-color( $alert-purple );
  162. }
  163. .jitm-card__link-indicator {
  164. align-items: center;
  165. color: $blue-wordpress;
  166. display: flex;
  167. }
  168. &:hover {
  169. transition: all 100ms ease-in-out;
  170. &.is-card-link {
  171. box-shadow: 0 0 0 1px $gray, 0 2px 4px lighten( $gray, 20% );
  172. }
  173. .jitm-card__link-indicator {
  174. color: $blue-dark;
  175. }
  176. }
  177. @include breakpoint( ">480px" ) {
  178. padding: rem( 12px ) rem( 16px );
  179. &.is-dismissible {
  180. padding-right: rem( 16px );
  181. }
  182. }
  183. }
  184. .jitm-banner__icons {
  185. display: flex;
  186. .jitm-banner__icon,
  187. .jitm-banner__icon-circle {
  188. border-radius: 50%;
  189. flex-shrink: 0;
  190. height: rem( 24px );
  191. width: rem( 24px );
  192. margin-right: rem( 16px );
  193. margin-top: rem( -2px );
  194. text-align: center;
  195. top: rem( 4px );
  196. }
  197. .jitm-banner__icon {
  198. align-self: center;
  199. color: $white;
  200. display: block;
  201. }
  202. .jitm-banner__icon-circle {
  203. color: white;
  204. display: none;
  205. padding: rem( 3px ) rem( 4px ) rem( 4px ) rem( 3px );
  206. }
  207. @include breakpoint( ">480px" ) {
  208. align-items: center;
  209. .jitm-banner__icon {
  210. display: none;
  211. }
  212. .jitm-banner__icon-circle {
  213. display: block;
  214. }
  215. }
  216. }
  217. .jitm-banner__icon-plan {
  218. display: flex;
  219. margin-right: rem( 16px );
  220. .dops-plan-icon {
  221. height: rem( 32px );
  222. width: rem( 32px );
  223. }
  224. .jp-emblem {
  225. position: relative;
  226. top: rem( 2px );
  227. @include breakpoint( "<480px" ) {
  228. margin-bottom: rem( 12px );
  229. }
  230. svg {
  231. height: rem( 32px );
  232. width: rem( 32px );
  233. fill: $green-primary;
  234. }
  235. }
  236. @include breakpoint( ">480px" ) {
  237. align-items: center;
  238. }
  239. }
  240. .jitm-banner__content {
  241. align-items: center;
  242. display: flex;
  243. flex-grow: 1;
  244. flex-wrap: wrap;
  245. @include breakpoint( ">480px" ) {
  246. flex-wrap: nowrap;
  247. }
  248. }
  249. .jitm-banner__info {
  250. flex-grow: 1;
  251. line-height: 1.4;
  252. @include breakpoint( ">480px" ) {
  253. flex-basis: 50%;
  254. }
  255. @include breakpoint( ">960px" ) {
  256. flex-basis: 70%;
  257. }
  258. .jitm-banner__title,
  259. .jitm-banner__description {
  260. color: $gray-dark;
  261. }
  262. .jitm-banner__title {
  263. font-size: 14px;
  264. font-weight: 500;
  265. }
  266. .jitm-banner__description {
  267. font-size: rem( 12px );
  268. line-height: 1.5;
  269. margin-top: rem( 6px );
  270. }
  271. .banner__list {
  272. font-size: 12px;
  273. list-style: none;
  274. margin: 10px 0;
  275. li {
  276. margin: 6px 0;
  277. .gridicon {
  278. fill: $gray;
  279. display: inline;
  280. margin-right: 12px;
  281. vertical-align: bottom;
  282. }
  283. }
  284. }
  285. }
  286. .jitm-banner__action {
  287. align-self: center;
  288. font-size: rem( 12px );
  289. margin: rem( 8px ) 0 0;
  290. text-align: left;
  291. width: 100%;
  292. .jitm-banner__prices {
  293. display: flex;
  294. justify-content: flex-start;
  295. .dops-plan-price {
  296. margin-bottom: 0;
  297. }
  298. .dops-plan-price.is-discounted,
  299. .dops-plan-price.is-discounted .dops-plan-price__currency-symbol {
  300. color: $gray-dark;
  301. }
  302. .has-call-to-action & .dops-plan-price {
  303. margin-bottom: rem( 8px );
  304. }
  305. }
  306. @include breakpoint( ">480px" ) {
  307. margin: 0 rem( 4px ) 0 rem( 8px );
  308. text-align: center;
  309. width: auto;
  310. .is-dismissible {
  311. margin-top: rem( 40px );
  312. }
  313. .jitm-banner__prices {
  314. justify-content: flex-end;
  315. text-align: right;
  316. }
  317. }
  318. }
  319. .jitm-banner__dismiss {
  320. display: block;
  321. text-decoration: none;
  322. line-height: .5;
  323. &:before {
  324. color: darken($gray, 20%);
  325. font: 400 16px/1 dashicons;
  326. content: '\f158';
  327. }
  328. @include breakpoint( ">660px" ) {
  329. margin-right: rem( -8px );
  330. }
  331. @include breakpoint( "<480px" ) {
  332. position: absolute;
  333. top: rem( 14px );
  334. right: rem( 14px );
  335. }
  336. }
  337. .jitm-banner__action + .jitm-banner__dismiss {
  338. margin-left: rem( 10px );
  339. }