What is Style function in Angular?

The style function is used to define a set of styles to associate with a given state name. We need to use it along with state() function to set CSS style attributes. For example, in the close state, the button has a height of 100 pixels, an opacity of 0.8, and a background color of green.

state('close', style({
  height: '100px',
  opacity: 0.8,
  backgroundColor: 'green'
})),