searchbar.wp.scss 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. @import "../../themes/ionic.globals.wp";
  2. // Windows Searchbar
  3. // --------------------------------------------------
  4. // deprecated
  5. $searchbar-wp-padding: null !default;
  6. /// @prop - Padding top of the searchbar
  7. $searchbar-wp-padding-top: 8px !default;
  8. /// @prop - Padding end of the searchbar
  9. $searchbar-wp-padding-end: $searchbar-wp-padding-top !default;
  10. /// @prop - Padding bottom of the searchbar
  11. $searchbar-wp-padding-bottom: $searchbar-wp-padding-top !default;
  12. /// @prop - Padding start of the searchbar
  13. $searchbar-wp-padding-start: $searchbar-wp-padding-end !default;
  14. /// @prop - Background of the searchbar
  15. $searchbar-wp-background-color: transparent !default;
  16. /// @prop - Border width of the searchbar
  17. $searchbar-wp-border-width: 2px !default;
  18. /// @prop - Border color of the searchbar
  19. $searchbar-wp-border-color: $input-wp-border-color !default;
  20. /// @prop - Border color of the searchbar on focus
  21. $searchbar-wp-border-color-focused: color($colors-wp, primary) !default;
  22. /// @prop - Color of the searchbar input search icon
  23. $searchbar-wp-input-search-icon-color: #858585 !default;
  24. /// @prop - Svg for the searchbar input search icon
  25. $searchbar-wp-input-search-icon-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='" + $searchbar-wp-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;
  26. /// @prop - Size of the searchbar input search icon
  27. $searchbar-wp-input-search-icon-size: 20px !default;
  28. /// @prop - Padding top/bottom of the searchbar input
  29. $searchbar-wp-input-padding-vertical: 0 !default;
  30. /// @prop - Padding start/end of the searchbar input
  31. $searchbar-wp-input-padding-horizontal: 8px !default;
  32. /// @prop - Height of the searchbar input
  33. $searchbar-wp-input-height: auto !default;
  34. /// @prop - Line height of the searchbar input
  35. $searchbar-wp-input-line-height: 3rem !default;
  36. /// @prop - Color of the searchbar input placeholder
  37. $searchbar-wp-input-placeholder-color: #858585 !default;
  38. /// @prop - Color of the searchbar input text
  39. $searchbar-wp-input-text-color: #141414 !default;
  40. /// @prop - Background of the searchbar input
  41. $searchbar-wp-input-background-color: #fff !default;
  42. /// @prop - Border radius of the searchbar input
  43. $searchbar-wp-input-border-radius: 0 !default;
  44. /// @prop - Font size of the searchbar input
  45. $searchbar-wp-input-font-size: 1.4rem !default;
  46. /// @prop - Font weight of the searchbar input
  47. $searchbar-wp-input-font-weight: 400 !default;
  48. /// @prop - Color of the searchbar input clear icon
  49. $searchbar-wp-input-clear-icon-color: #858585 !default;
  50. /// @prop - Svg for the searchbar input clear icon
  51. $searchbar-wp-input-clear-icon-svg: "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><polygon fill='" + $searchbar-wp-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;
  52. /// @prop - Size of the searchbar input clear icon
  53. $searchbar-wp-input-clear-icon-size: 22px !default;
  54. // Searchbar
  55. // -----------------------------------------
  56. .searchbar-wp {
  57. background: $searchbar-wp-background-color;
  58. @include deprecated-variable(padding, $searchbar-wp-padding) {
  59. @include padding($searchbar-wp-padding-top, $searchbar-wp-padding-end, $searchbar-wp-padding-bottom, $searchbar-wp-padding-start);
  60. }
  61. }
  62. .searchbar-wp .searchbar-input-container {
  63. border: $searchbar-wp-border-width solid $searchbar-wp-border-color;
  64. }
  65. // Searchbar Search Icon
  66. // -----------------------------------------
  67. .searchbar-wp .searchbar-search-icon {
  68. @include position(5px, $searchbar-wp-input-padding-horizontal, null, null);
  69. @include svg-background-image($searchbar-wp-input-search-icon-svg, true);
  70. position: absolute;
  71. width: $searchbar-wp-input-search-icon-size + 1;
  72. height: $searchbar-wp-input-search-icon-size + 1;
  73. background-repeat: no-repeat;
  74. background-size: $searchbar-wp-input-search-icon-size;
  75. }
  76. .searchbar-wp .searchbar-search-icon.activated {
  77. background-color: transparent;
  78. }
  79. // Searchbar Input Field
  80. // -----------------------------------------
  81. .searchbar-wp .searchbar-input {
  82. @include placeholder($searchbar-wp-input-placeholder-color);
  83. @include padding($searchbar-wp-input-padding-vertical, $searchbar-wp-input-padding-horizontal);
  84. @include border-radius($searchbar-wp-input-border-radius);
  85. @include background-position(start, $searchbar-wp-input-padding-horizontal, center);
  86. height: $searchbar-wp-input-height;
  87. font-size: $searchbar-wp-input-font-size;
  88. font-weight: $searchbar-wp-input-font-weight;
  89. line-height: $searchbar-wp-input-line-height;
  90. color: $searchbar-wp-input-text-color;
  91. background-color: $searchbar-wp-input-background-color;
  92. }
  93. // Searchbar Clear Input Icon
  94. // -----------------------------------------
  95. .searchbar-wp .searchbar-clear-icon {
  96. @include position(0, $searchbar-wp-input-padding-horizontal, null, null);
  97. @include svg-background-image($searchbar-wp-input-clear-icon-svg);
  98. @include padding(0);
  99. @include background-position(center);
  100. position: absolute;
  101. width: $searchbar-wp-input-clear-icon-size;
  102. height: 100%;
  103. background-repeat: no-repeat;
  104. background-size: $searchbar-wp-input-clear-icon-size;
  105. }
  106. .searchbar-wp .searchbar-clear-icon.activated {
  107. background-color: transparent;
  108. }
  109. // Searchbar Focused
  110. // -----------------------------------------
  111. .searchbar-wp.searchbar-has-focus .searchbar-input-container {
  112. border-color: $searchbar-wp-border-color-focused;
  113. }
  114. // Searchbar Left Aligned
  115. // -----------------------------------------
  116. .searchbar-wp.searchbar-has-value .searchbar-search-icon {
  117. display: none;
  118. }
  119. // Searchbar Cancel Icon (iOS only)
  120. // -----------------------------------------
  121. .searchbar-wp .searchbar-ios-cancel {
  122. display: none;
  123. }
  124. // Searchbar Cancel Icon (MD only)
  125. // -----------------------------------------
  126. .searchbar-wp .searchbar-md-cancel {
  127. display: none;
  128. }
  129. // Searchbar in Toolbar
  130. // -----------------------------------------
  131. .toolbar .searchbar-wp {
  132. @include padding(2px);
  133. }
  134. // Generate Default Windows Search Bar Colors
  135. // --------------------------------------------------
  136. @each $color-name, $color-base, $color-contrast in get-colors($colors-wp) {
  137. .searchbar-wp-#{$color-name}.searchbar-has-focus .searchbar-input-container {
  138. border-color: $color-base;
  139. }
  140. }