SwapIt / styles / feed.css
feed.css
Raw
:root{
  --font-color-dark: #323232;
  --font-color-light: #f5f5f5;
  --bg-color-light: #f5f5f5;
  --bg-color-dark: #323232;
  --input-focus: #2d8cf0;
  --font-color-sub: #666;
}

.feed-container{
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.feed-layout{
  display: inline-flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.product-cards{
  margin-top: 2rem;
}



.container-input {
    position: relative;
  }
  
.input {
    width: 150px;
    padding: 10px 0px 10px 40px;
    border-radius: 9999px;
    border: solid 1px var(--bg-color-dark);
    transition: all .2s ease-in-out;
    outline: none;
    opacity: 0.8;
  }
  
  .container-input svg {
    position: absolute;
    top: 50%;
    left: 10px;
    transform: translate(0, -50%);
  }
  
  .input:focus {
    opacity: 1;
    width: 250px;
  }

  /* Card */
  /* before adding the img to the div with the 
"card-img" class, remove css styles 
.card-img .img::before and .card-img .img::after,
then set the desired styles for .card-img. */
.card {
  --font-color:var(--bg-color-dark);
  --bg-color: var(--bg-color-light);
  --main-color: var(--bg-color-dark);
  --main-focus: var(--input-focus);
  width: 14rem;
  height: 18rem;
  background: var(--bg-);
  border: 2px solid var(--main-color);
  box-shadow: 4px 4px var(--main-color);
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 20px;
  gap: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

.card:last-child {
  justify-content: flex-end;
}

.card-img {
    /* clear and add new css */
    
  transition: all 0.5s;
  display: flex;
  justify-content: center;
  align-items: center;
}
.card-img img{
  border-radius: 5px;
  border: 2px solid var(--bg-color-dark);
  height: 150px;
  width: 100%;
}

.card-title {
  font-size: 20px;
  font-weight: 500;
  text-align: center;
  color: var(--font-color);
}

.card-subtitle {
  font-size: 14px;
  font-weight: 400;
  color: var(--font-color-sub);
}

.card-divider {
  width: 100%;
  border: 1px solid var(--main-color);
  border-radius: 50px;
}

.card-footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

.card-price {
  font-size: 20px;
  font-weight: 500;
  color: var(--font-color);
}

.card-price span {
  font-size: 20px;
  font-weight: 500;
  color: var(--font-color-sub);
}

.card-btn {
  background: var(--bg-color);
  border: 2px solid var(--main-color);
  border-radius: 50%;
  transition: all 0.3s;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-btn svg {
  width: 100%;
  height: 100%;
  fill: var(--main-color);
  transition: all 0.3s;
}

.card-img:hover {
  transform: translateY(-3px);
}

.card-btn:hover {
  border: 2px solid var(--main-focus);
}

.card-btn:hover svg {
  fill: var(--main-focus);
}

.card-btn:active {
  transform: translateY(3px);
}