concept src in category svelte

appears as: src
Svelte and Sapper in Action

This is an excerpt from Manning's book Svelte and Sapper in Action.

The value of Boolean props can be inferred from the absence of the prop, or its presence without specifying a value, as will be demonstrated in listing 5.5. The StopLight component renders a red or green circle. The on prop value is used to determine the color. When the prop is omitted, its value defaults to false. When the prop name is specified without a value, its value is inferred to be true.

  • Create a .svelte file for each component in the src directory.
  • .button {
      background-color: white;
      border-radius: 10px;
      color: gray;
      padding: 1rem;
      text-decoration: none;
    }