magnific-popup.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. /* Magnific Popup CSS */
  2. @import "settings";
  3. ////////////////////////
  4. //
  5. // Contents:
  6. //
  7. // 1. Default Settings
  8. // 2. General styles
  9. // - Transluscent overlay
  10. // - Containers, wrappers
  11. // - Cursors
  12. // - Helper classes
  13. // 3. Appearance
  14. // - Preloader & text that displays error messages
  15. // - CSS reset for buttons
  16. // - Close icon
  17. // - "1 of X" counter
  18. // - Navigation (left/right) arrows
  19. // - Iframe content type styles
  20. // - Image content type styles
  21. // - Media query where size of arrows is reduced
  22. // - IE7 support
  23. //
  24. ////////////////////////
  25. ////////////////////////
  26. // 1. Default Settings
  27. ////////////////////////
  28. $mfp-overlay-color: #0b0b0b !default;
  29. $mfp-overlay-opacity: 0.8 !default;
  30. $mfp-shadow: 0 0 8px rgba(0, 0, 0, 0.6) !default; // shadow on image or iframe
  31. $mfp-popup-padding-left: 8px !default; // Padding from left and from right side
  32. $mfp-popup-padding-left-mobile: 6px !default; // Same as above, but is applied when width of window is less than 800px
  33. $mfp-z-index-base: 1040 !default; // Base z-index of popup
  34. $mfp-include-arrows: true !default; // include styles for nav arrows
  35. $mfp-controls-opacity: 0.65 !default;
  36. $mfp-controls-color: #FFF !default;
  37. $mfp-controls-border-color: #3F3F3F !default;
  38. $mfp-inner-close-icon-color: #333 !default;
  39. $mfp-controls-text-color: #CCC !default; // Color of preloader and "1 of X" indicator
  40. $mfp-controls-text-color-hover: #FFF !default;
  41. $mfp-IE7support: true !default; // Very basic IE7 support
  42. // Iframe-type options
  43. $mfp-include-iframe-type: true !default;
  44. $mfp-iframe-padding-top: 40px !default;
  45. $mfp-iframe-background: #000 !default;
  46. $mfp-iframe-max-width: 900px !default;
  47. $mfp-iframe-ratio: 9/16 !default;
  48. // Image-type options
  49. $mfp-include-image-type: true !default;
  50. $mfp-image-background: #444 !default;
  51. $mfp-image-padding-top: 40px !default;
  52. $mfp-image-padding-bottom: 40px !default;
  53. $mfp-include-mobile-layout-for-image: true !default; // Removes paddings from top and bottom
  54. // Image caption options
  55. $mfp-caption-title-color: #F3F3F3 !default;
  56. $mfp-caption-subtitle-color: #BDBDBD !default;
  57. // A11y
  58. $mfp-use-visuallyhidden: false !default; // Hide content from browsers, but make it available for screen readers
  59. ////////////////////////
  60. // 2. General styles
  61. ////////////////////////
  62. // Transluscent overlay
  63. .mfp-bg {
  64. top: 0;
  65. left: 0;
  66. width: 100%;
  67. height: 100%;
  68. z-index: $mfp-z-index-base + 2;
  69. overflow: hidden;
  70. position: fixed;
  71. background: $mfp-overlay-color;
  72. opacity: $mfp-overlay-opacity;
  73. @if $mfp-IE7support {
  74. filter: unquote("alpha(opacity=#{$mfp-overlay-opacity*100})");
  75. }
  76. }
  77. // Wrapper for popup
  78. .mfp-wrap {
  79. top: 0;
  80. left: 0;
  81. width: 100%;
  82. height: 100%;
  83. z-index: $mfp-z-index-base + 3;
  84. position: fixed;
  85. outline: none !important;
  86. -webkit-backface-visibility: hidden; // fixes webkit bug that can cause "false" scrollbar
  87. }
  88. // Root container
  89. .mfp-container {
  90. text-align: center;
  91. position: absolute;
  92. width: 100%;
  93. height: 100%;
  94. left: 0;
  95. top: 0;
  96. padding: 0 $mfp-popup-padding-left;
  97. -webkit-box-sizing: border-box;
  98. -moz-box-sizing: border-box;
  99. box-sizing: border-box;
  100. }
  101. // Vertical centerer helper
  102. .mfp-container {
  103. &:before {
  104. content: '';
  105. display: inline-block;
  106. height: 100%;
  107. vertical-align: middle;
  108. }
  109. }
  110. // Remove vertical centering when popup has class `mfp-align-top`
  111. .mfp-align-top {
  112. .mfp-container {
  113. &:before {
  114. display: none;
  115. }
  116. }
  117. }
  118. // Popup content holder
  119. .mfp-content {
  120. position: relative;
  121. display: inline-block;
  122. vertical-align: middle;
  123. margin: 0 auto;
  124. text-align: left;
  125. z-index: $mfp-z-index-base + 5;
  126. }
  127. .mfp-inline-holder,
  128. .mfp-ajax-holder {
  129. .mfp-content {
  130. width: 100%;
  131. cursor: auto;
  132. }
  133. }
  134. // Cursors
  135. .mfp-ajax-cur {
  136. cursor: progress;
  137. }
  138. .mfp-zoom-out-cur {
  139. &, .mfp-image-holder .mfp-close {
  140. cursor: -moz-zoom-out;
  141. cursor: -webkit-zoom-out;
  142. cursor: zoom-out;
  143. }
  144. }
  145. .mfp-zoom {
  146. cursor: pointer;
  147. cursor: -webkit-zoom-in;
  148. cursor: -moz-zoom-in;
  149. cursor: zoom-in;
  150. }
  151. .mfp-auto-cursor {
  152. .mfp-content {
  153. cursor: auto;
  154. }
  155. }
  156. .mfp-close,
  157. .mfp-arrow,
  158. .mfp-preloader,
  159. .mfp-counter {
  160. -webkit-user-select:none;
  161. -moz-user-select: none;
  162. user-select: none;
  163. }
  164. // Hide the image during the loading
  165. .mfp-loading {
  166. &.mfp-figure {
  167. display: none;
  168. }
  169. }
  170. // Helper class that hides stuff
  171. @if $mfp-use-visuallyhidden {
  172. // From HTML5 Boilerplate https://github.com/h5bp/html5-boilerplate/blob/v4.2.0/doc/css.md#visuallyhidden
  173. .mfp-hide {
  174. border: 0 !important;
  175. clip: rect(0 0 0 0) !important;
  176. height: 1px !important;
  177. margin: -1px !important;
  178. overflow: hidden !important;
  179. padding: 0 !important;
  180. position: absolute !important;
  181. width: 1px !important;
  182. }
  183. } @else {
  184. .mfp-hide {
  185. display: none !important;
  186. }
  187. }
  188. ////////////////////////
  189. // 3. Appearance
  190. ////////////////////////
  191. // Preloader and text that displays error messages
  192. .mfp-preloader {
  193. color: $mfp-controls-text-color;
  194. position: absolute;
  195. top: 50%;
  196. width: auto;
  197. text-align: center;
  198. margin-top: -0.8em;
  199. left: 8px;
  200. right: 8px;
  201. z-index: $mfp-z-index-base + 4;
  202. a {
  203. color: $mfp-controls-text-color;
  204. &:hover {
  205. color: $mfp-controls-text-color-hover;
  206. }
  207. }
  208. }
  209. // Hide preloader when content successfully loaded
  210. .mfp-s-ready {
  211. .mfp-preloader {
  212. display: none;
  213. }
  214. }
  215. // Hide content when it was not loaded
  216. .mfp-s-error {
  217. .mfp-content {
  218. display: none;
  219. }
  220. }
  221. // CSS-reset for buttons
  222. button {
  223. &.mfp-close,
  224. &.mfp-arrow {
  225. overflow: visible;
  226. cursor: pointer;
  227. background: transparent;
  228. border: 0;
  229. -webkit-appearance: none;
  230. display: block;
  231. outline: none;
  232. padding: 0;
  233. z-index: $mfp-z-index-base + 6;
  234. -webkit-box-shadow: none;
  235. box-shadow: none;
  236. }
  237. &::-moz-focus-inner {
  238. padding: 0;
  239. border: 0
  240. }
  241. }
  242. // Close icon
  243. .mfp-close {
  244. width: 44px;
  245. height: 44px;
  246. line-height: 44px;
  247. position: absolute;
  248. right: 0;
  249. top: 0;
  250. text-decoration: none;
  251. text-align: center;
  252. opacity: $mfp-controls-opacity;
  253. @if $mfp-IE7support {
  254. filter: unquote("alpha(opacity=#{$mfp-controls-opacity*100})");
  255. }
  256. padding: 0 0 18px 10px;
  257. color: $mfp-controls-color;
  258. font-style: normal;
  259. font-size: 28px;
  260. font-family: Arial, Baskerville, monospace;
  261. &:hover,
  262. &:focus {
  263. opacity: 1;
  264. @if $mfp-IE7support {
  265. filter: unquote("alpha(opacity=#{1*100})");
  266. }
  267. }
  268. &:active {
  269. top: 1px;
  270. }
  271. }
  272. .mfp-close-btn-in {
  273. .mfp-close {
  274. color: $mfp-inner-close-icon-color;
  275. }
  276. }
  277. .mfp-image-holder,
  278. .mfp-iframe-holder {
  279. .mfp-close {
  280. color: $mfp-controls-color;
  281. right: -6px;
  282. text-align: right;
  283. padding-right: 6px;
  284. width: 100%;
  285. }
  286. }
  287. // "1 of X" counter
  288. .mfp-counter {
  289. position: absolute;
  290. top: 0;
  291. right: 0;
  292. color: $mfp-controls-text-color;
  293. font-size: 12px;
  294. line-height: 18px;
  295. }
  296. // Navigation arrows
  297. @if $mfp-include-arrows {
  298. .mfp-arrow {
  299. position: absolute;
  300. opacity: $mfp-controls-opacity;
  301. @if $mfp-IE7support {
  302. filter: unquote("alpha(opacity=#{$mfp-controls-opacity*100})");
  303. }
  304. margin: 0;
  305. top: 50%;
  306. margin-top: -55px;
  307. padding: 0;
  308. width: 90px;
  309. height: 110px;
  310. -webkit-tap-highlight-color: rgba(0,0,0,0);
  311. &:active {
  312. margin-top: -54px;
  313. }
  314. &:hover,
  315. &:focus {
  316. opacity: 1;
  317. @if $mfp-IE7support {
  318. filter: unquote("alpha(opacity=#{1*100})");
  319. }
  320. }
  321. &:before,
  322. &:after,
  323. .mfp-b,
  324. .mfp-a {
  325. content: '';
  326. display: block;
  327. width: 0;
  328. height: 0;
  329. position: absolute;
  330. left: 0;
  331. top: 0;
  332. margin-top: 35px;
  333. margin-left: 35px;
  334. border: medium inset transparent;
  335. }
  336. &:after,
  337. .mfp-a {
  338. border-top-width: 13px;
  339. border-bottom-width: 13px;
  340. top:8px;
  341. }
  342. &:before,
  343. .mfp-b {
  344. border-top-width: 21px;
  345. border-bottom-width: 21px;
  346. opacity: 0.7;
  347. }
  348. }
  349. .mfp-arrow-left {
  350. left: 0;
  351. &:after,
  352. .mfp-a {
  353. border-right: 17px solid $mfp-controls-color;
  354. margin-left: 31px;
  355. }
  356. &:before,
  357. .mfp-b {
  358. margin-left: 25px;
  359. border-right: 27px solid $mfp-controls-border-color;
  360. }
  361. }
  362. .mfp-arrow-right {
  363. right: 0;
  364. &:after,
  365. .mfp-a {
  366. border-left: 17px solid $mfp-controls-color;
  367. margin-left: 39px
  368. }
  369. &:before,
  370. .mfp-b {
  371. border-left: 27px solid $mfp-controls-border-color;
  372. }
  373. }
  374. }
  375. // Iframe content type
  376. @if $mfp-include-iframe-type {
  377. .mfp-iframe-holder {
  378. padding-top: $mfp-iframe-padding-top;
  379. padding-bottom: $mfp-iframe-padding-top;
  380. .mfp-content {
  381. line-height: 0;
  382. width: 100%;
  383. max-width: $mfp-iframe-max-width;
  384. }
  385. .mfp-close {
  386. top: -40px;
  387. }
  388. }
  389. .mfp-iframe-scaler {
  390. width: 100%;
  391. height: 0;
  392. overflow: hidden;
  393. padding-top: $mfp-iframe-ratio * 100%;
  394. iframe {
  395. position: absolute;
  396. display: block;
  397. top: 0;
  398. left: 0;
  399. width: 100%;
  400. height: 100%;
  401. box-shadow: $mfp-shadow;
  402. background: $mfp-iframe-background;
  403. }
  404. }
  405. }
  406. // Image content type
  407. @if $mfp-include-image-type {
  408. /* Main image in popup */
  409. img {
  410. &.mfp-img {
  411. width: auto;
  412. max-width: 100%;
  413. height: auto;
  414. display: block;
  415. line-height: 0;
  416. -webkit-box-sizing: border-box;
  417. -moz-box-sizing: border-box;
  418. box-sizing: border-box;
  419. padding: $mfp-image-padding-top 0 $mfp-image-padding-bottom;
  420. margin: 0 auto;
  421. }
  422. }
  423. /* The shadow behind the image */
  424. .mfp-figure {
  425. line-height: 0;
  426. &:after {
  427. content: '';
  428. position: absolute;
  429. left: 0;
  430. top: $mfp-image-padding-top;
  431. bottom: $mfp-image-padding-bottom;
  432. display: block;
  433. right: 0;
  434. width: auto;
  435. height: auto;
  436. z-index: -1;
  437. box-shadow: $mfp-shadow;
  438. background: $mfp-image-background;
  439. }
  440. small {
  441. color: $mfp-caption-subtitle-color;
  442. display: block;
  443. font-size: 12px;
  444. line-height: 14px;
  445. }
  446. figure {
  447. margin: 0;
  448. }
  449. }
  450. .mfp-bottom-bar {
  451. margin-top: -$mfp-image-padding-bottom + 4;
  452. position: absolute;
  453. top: 100%;
  454. left: 0;
  455. width: 100%;
  456. cursor: auto;
  457. }
  458. .mfp-title {
  459. text-align: left;
  460. line-height: 18px;
  461. color: $mfp-caption-title-color;
  462. word-wrap: break-word;
  463. padding-right: 36px; // leave some space for counter at right side
  464. }
  465. .mfp-image-holder {
  466. .mfp-content {
  467. max-width: 100%;
  468. }
  469. }
  470. .mfp-gallery {
  471. .mfp-image-holder {
  472. .mfp-figure {
  473. cursor: pointer;
  474. }
  475. }
  476. }
  477. @if $mfp-include-mobile-layout-for-image {
  478. @media screen and (max-width: 800px) and (orientation:landscape), screen and (max-height: 300px) {
  479. /**
  480. * Remove all paddings around the image on small screen
  481. */
  482. .mfp-img-mobile {
  483. .mfp-image-holder {
  484. padding-left: 0;
  485. padding-right: 0;
  486. }
  487. img {
  488. &.mfp-img {
  489. padding: 0;
  490. }
  491. }
  492. .mfp-figure {
  493. // The shadow behind the image
  494. &:after {
  495. top: 0;
  496. bottom: 0;
  497. }
  498. small {
  499. display: inline;
  500. margin-left: 5px;
  501. }
  502. }
  503. .mfp-bottom-bar {
  504. background: rgba(0,0,0,0.6);
  505. bottom: 0;
  506. margin: 0;
  507. top: auto;
  508. padding: 3px 5px;
  509. position: fixed;
  510. -webkit-box-sizing: border-box;
  511. -moz-box-sizing: border-box;
  512. box-sizing: border-box;
  513. &:empty {
  514. padding: 0;
  515. }
  516. }
  517. .mfp-counter {
  518. right: 5px;
  519. top: 3px;
  520. }
  521. .mfp-close {
  522. top: 0;
  523. right: 0;
  524. width: 35px;
  525. height: 35px;
  526. line-height: 35px;
  527. background: rgba(0, 0, 0, 0.6);
  528. position: fixed;
  529. text-align: center;
  530. padding: 0;
  531. }
  532. }
  533. }
  534. }
  535. }
  536. // Scale navigation arrows and reduce padding from sides
  537. @media all and (max-width: 900px) {
  538. .mfp-arrow {
  539. -webkit-transform: scale(0.75);
  540. transform: scale(0.75);
  541. }
  542. .mfp-arrow-left {
  543. -webkit-transform-origin: 0;
  544. transform-origin: 0;
  545. }
  546. .mfp-arrow-right {
  547. -webkit-transform-origin: 100%;
  548. transform-origin: 100%;
  549. }
  550. .mfp-container {
  551. padding-left: $mfp-popup-padding-left-mobile;
  552. padding-right: $mfp-popup-padding-left-mobile;
  553. }
  554. }
  555. // IE7 support
  556. // Styles that make popup look nicier in old IE
  557. @if $mfp-IE7support {
  558. .mfp-ie7 {
  559. .mfp-img {
  560. padding: 0;
  561. }
  562. .mfp-bottom-bar {
  563. width: 600px;
  564. left: 50%;
  565. margin-left: -300px;
  566. margin-top: 5px;
  567. padding-bottom: 5px;
  568. }
  569. .mfp-container {
  570. padding: 0;
  571. }
  572. .mfp-content {
  573. padding-top: 44px;
  574. }
  575. .mfp-close {
  576. top: 0;
  577. right: 0;
  578. padding-top: 0;
  579. }
  580. }
  581. }