sankethbk7777

Navbar.css

Jun 21st, 2021
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 KB | None | 0 0
  1. /* Navbar container styles */
  2. nav {
  3. position: fixed;
  4. top: 0;
  5. width: 100%;
  6. }
  7.  
  8. .nav-container {
  9. display: flex;
  10. align-items: center;
  11. height: 50px;
  12. background-color: white;
  13. /* font-family: 'Poppins', sans-serif; */
  14. justify-content: space-around;
  15. background-color: orange;
  16. }
  17.  
  18. /* Logo (text) styles */
  19.  
  20. .logo {
  21. color: rgb(37, 14, 14);
  22. text-transform: uppercase;
  23. letter-spacing: 5px;
  24. font-size: 20px;
  25. min-height: 26px; /* WARNING: Setting the hardcoded height here */
  26. }
  27.  
  28. .logo h4 {
  29. margin: 3px auto;
  30. }
  31.  
  32. /* Nav links styles */
  33.  
  34. .nav-links {
  35. display: flex;
  36. justify-content: space-around;
  37. width: 20%;
  38. max-width: 200px;
  39. margin: 15px;
  40. }
  41.  
  42. .nav-icon-container {
  43. width: auto;
  44. height: 30px;
  45. display: flex;
  46. justify-content: center;
  47. align-items: center;
  48. padding: 2px;
  49. background-color: blue;
  50.  
  51. /* background-color: cyan; */
  52. }
  53.  
  54. .nav-icon {
  55. font-size: 25px;
  56. color: rgb(0, 0, 0);
  57. font-weight: 300;
  58. }
  59.  
  60. /* Desktop search bar styles */
  61.  
  62. .search-bar {
  63. display: flex;
  64. height: 50%;
  65. position: relative;
  66. width: 246px;
  67. }
  68.  
  69. .search-form {
  70. width: 100%;
  71. }
  72.  
  73. .search-input {
  74. height: 100%;
  75. padding: 3px;
  76. border: 1px solid rgb(0, 0, 0);
  77. background-color: rgba(243, 242, 242);
  78. border-radius: 25px;
  79. width: 100%;
  80. padding: 10px;
  81. letter-spacing: var(--spacing);
  82. border: none;
  83. }
  84.  
  85. .search-placeholder-container {
  86. position: absolute;
  87. top: 7%;
  88. left: 35%;
  89. }
  90.  
  91. .search-submit-button {
  92. width: 0px;
  93. height: 0px;
  94. margin: 0;
  95. padding: 0;
  96. border: none;
  97. }
  98.  
  99. .search-icon {
  100. display: inline-block;
  101. margin-right: 5px;
  102. height: 80%;
  103. margin-top: 2px;
  104. color: var(--clr-grey-5);
  105. font-size: 10px;
  106. }
  107.  
  108. .placeholder-text {
  109. color: var(--clr-grey-8);
  110. font-size: 15px;
  111. }
  112.  
  113. /* Desktop search bar focussed */
  114.  
  115. .search-bar input:focus {
  116. border: none;
  117. outline: none;
  118. }
  119.  
  120. .placeholder-text-active {
  121. display: none;
  122. transform: translateY(100%);
  123. }
  124.  
  125. .search-placeholder-active {
  126. left: 90% !important;
  127. }
  128.  
  129. /* Nav links mobile */
  130.  
  131. .nav-links-mobile {
  132. min-width: 75px;
  133. justify-content: space-around;
  134. display: none;
  135. background-color: greenyellow;
  136. }
  137.  
  138. /* Search bar mobile */
  139.  
  140. .search-input-mobile {
  141. width: 0px;
  142. height: 0px;
  143. border: none;
  144. transition: 300ms;
  145. /* background-color: rgba(243, 242, 242); */
  146. background-color: red;
  147. }
  148.  
  149. .search-icon-mobile {
  150. transition: 300ms;
  151. }
  152.  
  153. .search-submit-button-mobile {
  154. width: 0px;
  155. height: 0px;
  156. padding: 0;
  157. margin: 0;
  158. border: none;
  159. }
  160.  
  161. .search-close-button-mobile {
  162. position: absolute;
  163. color: var(--clr-grey-5);
  164. font-size: 13px;
  165. right: 3%;
  166. top: 25%;
  167. display: none;
  168. }
  169.  
  170. /* Mobile search bar active */
  171.  
  172. .nav-links-mobile {
  173. padding: 3px;
  174. height: 35px;
  175. background-color: greenyellow;
  176. }
  177.  
  178. /* Mobile search bar active */
  179.  
  180. .search-input-mobile-active {
  181. width: 70vw;
  182. height: 23px;
  183. border: none;
  184. outline: none;
  185. border-radius: 25px;
  186. padding-left: 25px;
  187. }
  188.  
  189. .search-icon-mobile-active {
  190. position: absolute;
  191. top: 2%;
  192. left: 5%;
  193. display: inline-block;
  194. margin-right: 5px;
  195. height: 80%;
  196. margin-top: 2px;
  197. color: var(--clr-grey-5);
  198. font-size: 10px;
  199. }
  200.  
  201. .search-bar-mobile-active {
  202. position: relative;
  203. }
  204.  
  205. .search-close-button-mobile-active {
  206. display: block;
  207. }
  208.  
  209. /* Since nav-icon-container has fixed width we can't properly expand input. So we set the width to auto */
  210. .search-container-mobile {
  211. width: auto;
  212. margin-right: 10px;
  213. height: auto;
  214. }
  215.  
  216. .nav-link {
  217. height: 100%;
  218. }
  219.  
  220. /* Tablets */
  221.  
  222. @media all and (max-width: 1100px) {
  223. .search-bar {
  224. max-width: 190px;
  225. }
  226.  
  227. .nav-links {
  228. width: 31%;
  229. }
  230. }
  231.  
  232. /* Mobiles */
  233.  
  234. @media all and (max-width: 650px) {
  235. .nav-links {
  236. position: fixed;
  237. bottom: 0;
  238. width: 100%;
  239. background-color: white;
  240. max-width: 100%;
  241. margin-bottom: 0px;
  242. padding: 15px;
  243. }
  244.  
  245. .drop-down {
  246. display: none;
  247. }
  248.  
  249. .search-bar {
  250. display: none;
  251. }
  252.  
  253. .nav-links-mobile {
  254. display: flex;
  255. margin-right: 5%;
  256. }
  257.  
  258. .logo {
  259. flex-grow: 1;
  260. text-align: center;
  261. background-color: green;
  262. }
  263. }
  264.  
Advertisement
Add Comment
Please, Sign In to add comment