G
G
gazes122022-04-13 20:45:34
Preprocessors
gazes12, 2022-04-13 20:45:34

How to make such a mixin?

Here are the outlines:

@mixin placeholder($text){   /*Сюда должно считыватся значение из placeholder*/
  ::placeholder:{
    ::focus{
      opacity: 0;			/*При фокусе значение должно изчезать*/
    }
  }
}


Please help, I don't know how to do this. thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2022-04-13
@delphinpro

@mixin placeholder(){
  &::placeholder {
    color: #ccc;
  }
  &::placeholder:focus {
    opacity: 0;
  }
}

input {
  @include placeholder();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question