G
G
gazes122022-03-02 14:30:40
Sass
gazes12, 2022-03-02 14:30:40

How to climb up the element tree in sass?

.register {
  color: black;
  margin: 50px 0px 0px 0px;
  &__container {}
  &__form {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 50px;

    color: #3B586B;
  }

  &__title{
    font-size: 60px;
    color: #FDF5E6;
    text-align: center;
  }

  input{
    background: #8DA399;
    border: none;
    border-radius: 50px;
    height: 80px;
    padding: 0px 0px 0px 20px;

    box-shadow: 3px 3px #4D5954, -1em 0 .4em #D5F6E7;

    outline: none;

    font-weight: 700;

    &::placeholder{
      color: #45504B;
    }

    &:focus{
      &::placeholder{
        color: #C0DED1;
      }

      .register__image{
        opacity: 1;
      }
    }
  }

  &__login {
    width: 90%;
  }
  &__password {
    width: 70%;
    margin: 50px 0px 0px 0px;
  }

  &__button {
    transition: color ease 0.2s;
    margin: 50px 0px 0px 0px;
    font-size: 50px;

    color: #50C878;

    &:hover{
      color: #C0DED1;
    }
  }
  &__image {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;

    z-index: -1;
    opacity: 0.2;
  }
}


when input is focused, I want .register__image to be set to opacity 1, well, I don't know how to tell it.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question