My Works & learnings

CSS learnings

September 04, 2019

Transform Style

  1. transform-style property works on the parent

transform-style:preserve-3d;

  1. transform-style on the parent helped to make the translate3d work in the z-direction for the child

transform:translate3d(0px,0px,-0px);

Perspective

  1. Perspective also works on the parent and children
  2. This is the distance from the z-plane

transform:perspective(60px);

Background size

  1. Background size can accept cover which makes the background image to cover the full view.

background-size:cover;

Toggle in JavaScript

The JAVASCRIPT provides API to toggle a class in the DOM Node. This would help us in the use cases of toggling a class on A DOM. It also accepts second parameter which is a condition to execute the toggle. domNode.classList.toggle('hover', true);


Vishnu Sandhireddy

Written by Vishnu Sandhireddy who lives and works in Hyderabad, India. twitter