searchbar.md.scss 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. @import "../../themes/ionic.globals.md";
  2. // Material Design Searchbar
  3. // --------------------------------------------------
  4. // deprecated
  5. $searchbar-md-padding: null !default;
  6. /// @prop - Padding top of the searchbar
  7. $searchbar-md-padding-top: 8px !default;
  8. /// @prop - Padding end of the searchbar
  9. $searchbar-md-padding-end: $searchbar-md-padding-top !default;
  10. /// @prop - Padding bottom of the searchbar
  11. $searchbar-md-padding-bottom: $searchbar-md-padding-top !default;
  12. /// @prop - Padding start of the searchbar
  13. $searchbar-md-padding-start: $searchbar-md-padding-end !default;
  14. /// @prop - Background of the searchbar
  15. $searchbar-md-background-color: inherit !default;
  16. /// @prop - Color of the searchbar input search icon
  17. $searchbar-md-input-search-icon-color: #5b5b5b !default;
  18. /// @prop - Svg for the searchbar input search icon
  19. $searchbar-md-input-search-icon-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='" + $searchbar-md-input-search-icon-color + "' d='M337.509,305.372h-17.501l-6.571-5.486c20.791-25.232,33.922-57.054,33.922-93.257C347.358,127.632,283.896,64,205.135,64C127.452,64,64,127.632,64,206.629s63.452,142.628,142.225,142.628c35.011,0,67.831-13.167,92.991-34.008l6.561,5.487v17.551L415.18,448L448,415.086L337.509,305.372z M206.225,305.372c-54.702,0-98.463-43.887-98.463-98.743c0-54.858,43.761-98.742,98.463-98.742c54.7,0,98.462,43.884,98.462,98.742C304.687,261.485,260.925,305.372,206.225,305.372z'/></svg>" !default;
  20. /// @prop - Size of the searchbar input search icon
  21. $searchbar-md-input-search-icon-size: 20px !default;
  22. /// @prop - Height of the searchbar input
  23. $searchbar-md-input-height: auto !default;
  24. /// @prop - Line height of the searchbar input
  25. $searchbar-md-input-line-height: 3rem !default;
  26. /// @prop - Box shadow of the searchbar input
  27. $searchbar-md-input-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
  28. /// @prop - Color of the searchbar input placeholder
  29. $searchbar-md-input-placeholder-color: #aeaeae !default;
  30. /// @prop - Color of the searchbar input text
  31. $searchbar-md-input-text-color: #141414 !default;
  32. /// @prop - Background of the searchbar input
  33. $searchbar-md-input-background-color: #fff !default;
  34. /// @prop - Border radius of the searchbar input
  35. $searchbar-md-input-border-radius: 2px !default;
  36. /// @prop - Color of the searchbar input clear icon
  37. $searchbar-md-input-clear-icon-color: #5b5b5b !default;
  38. /// @prop - Svg for the searchbar input clear icon
  39. $searchbar-md-input-clear-icon-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><polygon fill='" + $searchbar-md-input-clear-icon-color + "' points='405,136.798 375.202,107 256,226.202 136.798,107 107,136.798 226.202,256 107,375.202 136.798,405 256,285.798 375.202,405 405,375.202 285.798,256'/></svg>" !default;
  40. /// @prop - Size of the searchbar input clear icon
  41. $searchbar-md-input-clear-icon-size: 22px !default;
  42. // Searchbar
  43. // -----------------------------------------
  44. .searchbar-md {
  45. background: $searchbar-md-background-color;
  46. @include deprecated-variable(padding, $searchbar-md-padding) {
  47. @include padding($searchbar-md-padding-top, $searchbar-md-padding-end, $searchbar-md-padding-bottom, $searchbar-md-padding-start);
  48. }
  49. }
  50. // Searchbar Search Icon
  51. // -----------------------------------------
  52. .searchbar-md .searchbar-search-icon {
  53. @include position(11px, null, null, 16px);
  54. @include svg-background-image($searchbar-md-input-search-icon-svg, true);
  55. width: $searchbar-md-input-search-icon-size + 1;
  56. height: $searchbar-md-input-search-icon-size + 1;
  57. }
  58. // Searchbar Cancel Icon (MD only)
  59. // -----------------------------------------
  60. .searchbar-md .searchbar-md-cancel {
  61. @include position(0, null, null, 10px);
  62. @include margin(0);
  63. display: none;
  64. width: $searchbar-md-input-search-icon-size + 1;
  65. height: 100%;
  66. }
  67. // Searchbar Search & Cancel Icon
  68. // -----------------------------------------
  69. .searchbar-md .searchbar-search-icon,
  70. .searchbar-md .searchbar-md-cancel {
  71. position: absolute;
  72. background-repeat: no-repeat;
  73. background-size: $searchbar-md-input-search-icon-size;
  74. }
  75. .searchbar-md .searchbar-search-icon.activated,
  76. .searchbar-md .searchbar-md-cancel.activated {
  77. background-color: transparent;
  78. }
  79. // Searchbar Input Field
  80. // -----------------------------------------
  81. .searchbar-md .searchbar-input {
  82. @include placeholder($searchbar-md-input-placeholder-color);
  83. @include padding(6px, 55px);
  84. @include border-radius($searchbar-md-input-border-radius);
  85. @include background-position(start, 8px, center);
  86. height: $searchbar-md-input-height;
  87. font-size: 1.6rem;
  88. font-weight: 400;
  89. line-height: $searchbar-md-input-line-height;
  90. color: $searchbar-md-input-text-color;
  91. background-color: $searchbar-md-input-background-color;
  92. box-shadow: $searchbar-md-input-box-shadow;
  93. }
  94. // Searchbar Clear Input Icon
  95. // -----------------------------------------
  96. .searchbar-md .searchbar-clear-icon {
  97. @include position(0, 13px, null, null);
  98. @include svg-background-image($searchbar-md-input-clear-icon-svg);
  99. @include padding(0);
  100. @include background-position(center);
  101. position: absolute;
  102. width: $searchbar-md-input-clear-icon-size;
  103. height: 100%;
  104. background-repeat: no-repeat;
  105. background-size: $searchbar-md-input-clear-icon-size;
  106. }
  107. .searchbar-md .searchbar-clear-icon.activated {
  108. background-color: transparent;
  109. }
  110. // Searchbar Focused
  111. // -----------------------------------------
  112. .searchbar-md.searchbar-has-focus.searchbar-show-cancel .searchbar-search-icon {
  113. display: none;
  114. }
  115. .searchbar-md.searchbar-has-focus.searchbar-show-cancel .searchbar-md-cancel {
  116. display: inline-flex;
  117. }
  118. // Searchbar in Toolbar
  119. // -----------------------------------------
  120. .toolbar .searchbar-md {
  121. @include padding(3px);
  122. }
  123. .toolbar .searchbar-md .searchbar-md-cancel {
  124. @include position-horizontal(14px, null);
  125. }
  126. // Searchbar Cancel Icon (iOS only)
  127. // -----------------------------------------
  128. .searchbar-md .searchbar-ios-cancel {
  129. display: none;
  130. }