In this lesson, we create a second lens for our Egghead spectacles. These are a mirror image of each other. Instead of writing out the styles again, we can reuse the styles and make use of the specific class to override the positioning and transform in order to mirror the right lens.
Jhey Tompkins: [0:00] Now we're ready to style the second lens, our right lens. It needs to be on the right side of our container. We can use a value of right: . Now our transform value needs to change. There we will define a rotation of -10deg. We also need to rotate the element on the Y axis to mirror it.
[0:23] Our rotation isn't quite right, so maybe +10deg will work. And it does. Because by default our lens is styled to be the left lens, we don't need to use the left lens class. The right lens class we can use to overwrite the shared styles and position our right lens accordingly.
[0:41] In review, to style the second lens, or the right lens, we've used the shared styles from the specs__lens class, but we overwrite the positioning and the transform to get the desired result.
Member comments are a way for members to communicate, interact, and ask questions about a lesson.
The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io
Be on-Topic
Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.
Avoid meta-discussion
Code Problems?
Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context
Details and Context
Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!