2
0

_chooser.scss 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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. overridden 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. .icon {
  25. color: $color-grey-3;
  26. @include svg-icon(2.5em);
  27. vertical-align: middle;
  28. margin-right: 0.625rem;
  29. }
  30. // TODO: [icon-font] remove when the Wagtail icon font is removed
  31. &:before {
  32. vertical-align: middle;
  33. font-family: wagtail;
  34. content: '';
  35. // position: relative
  36. display: inline-block;
  37. // float: left;
  38. color: $color-grey-3;
  39. line-height: 1em;
  40. font-size: 2.5em;
  41. margin-right: 0.3em;
  42. }
  43. }
  44. .unchosen {
  45. display: none;
  46. }
  47. .actions {
  48. @include clearfix;
  49. overflow: hidden;
  50. li {
  51. float: left;
  52. margin: 0.3em;
  53. }
  54. }
  55. // ...unless the .page-chooser has the 'blank' class set
  56. &.blank {
  57. .chosen { display: none; }
  58. .unchosen { display: block; }
  59. }
  60. }
  61. // standard way of doing a chooser where the chosen object's title is overlaid
  62. .page-chooser,
  63. .snippet-chooser,
  64. .document-chooser {
  65. .chosen {
  66. .title {
  67. color: $color-grey-1;
  68. // display: block;
  69. padding-left: 1em;
  70. display: inline-block;
  71. }
  72. .actions {
  73. clear: both;
  74. padding-top: 0.6em;
  75. }
  76. }
  77. }
  78. // TODO: [icon-font] remove when the Wagtail icon font is removed
  79. .page-chooser,
  80. .snippet-chooser,
  81. .document-chooser,
  82. .image-chooser {
  83. .unchosen,
  84. .chosen {
  85. &:before {
  86. display: none;
  87. }
  88. }
  89. }
  90. .image-chooser {
  91. .chosen {
  92. padding-left: $thumbnail-width;
  93. &:before {
  94. display: inline-block;
  95. }
  96. .preview-image {
  97. float: left;
  98. margin-left: -($thumbnail-width);
  99. margin-right: 1em;
  100. max-width: $thumbnail-width;
  101. // Resize standard Wagtail thumbnail size (165x165) to 130 for space-saving purposes.
  102. // We could request a 130x130 rendition, but that's just unnecessary and burdens installations
  103. // where images are store off-site with higher rendering times.
  104. img {
  105. max-width: $thumbnail-width;
  106. max-height: $thumbnail-width;
  107. height: auto;
  108. width: auto;
  109. }
  110. }
  111. }
  112. }