_chooser.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. TODO this chooser style has been made more generic based on two identical
  3. methods for choosing pages and images that were previously included in their
  4. own less files in each app directory (and since deleted). It would be best if
  5. an admin 'theme' provided all the design for a UI in a single place, but
  6. should that be a series of overrides to the css provided from an app? If so,
  7. perhaps those two previous less files should be re-instated and then
  8. overriden here? hmm.
  9. */
  10. .chooser {
  11. // We show the 'chosen' state...
  12. @include clearfix();
  13. input[type=text] {
  14. float: left;
  15. width: 50%;
  16. margin-right: 1em;
  17. }
  18. .chosen {
  19. display: block;
  20. }
  21. .unchosen,
  22. .chosen {
  23. position: relative;
  24. &:before {
  25. vertical-align: middle;
  26. font-family: wagtail;
  27. content: '';
  28. // position: relative
  29. display: inline-block;
  30. // float: left;
  31. color: $color-grey-3;
  32. line-height: 1em;
  33. font-size: 2.5em;
  34. margin-right: 0.3em;
  35. }
  36. }
  37. .unchosen {
  38. display: none;
  39. }
  40. .actions {
  41. @include clearfix;
  42. overflow: hidden;
  43. li {
  44. float: left;
  45. margin: 0.3em;
  46. }
  47. }
  48. // ...unless the .page-chooser has the 'blank' class set
  49. &.blank {
  50. .chosen { display: none; }
  51. .unchosen { display: block; }
  52. }
  53. }
  54. // standard way of doing a chooser where the chosen object's title is overlaid
  55. .page-chooser,
  56. .snippet-chooser,
  57. .document-chooser {
  58. .chosen {
  59. .title {
  60. color: $color-grey-1;
  61. // display: block;
  62. padding-left: 1em;
  63. display: inline-block;
  64. }
  65. .actions {
  66. clear: both;
  67. padding-top: 0.6em;
  68. }
  69. }
  70. }
  71. .page-chooser {
  72. .unchosen,
  73. .chosen {
  74. &:before {
  75. content: 'b';
  76. }
  77. }
  78. }
  79. .snippet-chooser {
  80. .unchosen,
  81. .chosen {
  82. &:before {
  83. content: 'D';
  84. }
  85. }
  86. }
  87. .document-chooser {
  88. .unchosen,
  89. .chosen {
  90. &:before {
  91. content: 'r';
  92. }
  93. }
  94. }
  95. .image-chooser {
  96. .unchosen,
  97. .chosen {
  98. &:before {
  99. content: 'o';
  100. }
  101. }
  102. .chosen {
  103. padding-left: $thumbnail-width;
  104. &:before {
  105. content: '';
  106. }
  107. .preview-image {
  108. float: left;
  109. margin-left: -($thumbnail-width);
  110. margin-right: 1em;
  111. max-width: $thumbnail-width;
  112. // Resize standard Wagtail thumbnail size (165x165) to 130 for space-saving purposes.
  113. // We could request a 130x130 rendition, but that's just unnecessary and burdens installations
  114. // where images are store off-site with higher rendering times.
  115. img {
  116. max-width: $thumbnail-width;
  117. max-height: $thumbnail-width;
  118. height: auto;
  119. width: auto;
  120. }
  121. }
  122. }
  123. }