I
I
Igor Nistakov2016-06-09 22:36:48
css
Igor Nistakov, 2016-06-09 22:36:48

Is it possible to use this css(sass) construct?

Is such a construction acceptable? If not, please advise how you can describe it differently.

.selector
//something properties

  &:focus > img
    transform: rotate(0deg)
    
  &:hover, &:focus
    cursor: pointer
    background-color: lighten($circle, 10%)
    -webkit-box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)
    box-shadow: 0 8px 15px 0 rgba(0,0,0,0.3)

  &:focus ~ .subs button:nth-of-type(2)
    transform: scale(1)
    opacity: 1
  &:focus ~ .subs button:nth-of-type(3)
    transform: scale(1)
    opacity: 1

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DTX, 2016-06-10
@DirecTwiX

Yes, it seems to apply.
codepen.io/anon/pen/dXGRqB
But how would you nest elements within an element that could be :focus?
I'm talking about the line
&: focus > img
* the first time for some reason the link was not attached

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question