Skip to content

Instantly share code, notes, and snippets.

@crcn
Created July 18, 2022 21:26
Show Gist options
  • Save crcn/f5f702948bac5c5fe812635caa5dd59a to your computer and use it in GitHub Desktop.
Save crcn/f5f702948bac5c5fe812635caa5dd59a to your computer and use it in GitHub Desktop.

CSS:

.Button {
  border: none;
  padding: 16px;
  
  &--primary {
    background: blue;
    &:hover {
      background: lightblue;
    }
  }
  &--secondary {
    background: red;
    &:hover {
      background: lightred;
    }
  }
}

Paperclip:

component Button {
  variant primary;
  variant secondary;
  variant hover (enabled: [PseudoElement.Hover]);
  
  render button {
    style {
      border: none;
      padding: 16px;
      if primary {
        background: blue;
        if hover {
          background: lightblue;
        }
      }
      if secondary {
        background: red;
        if hover {
          background: lightred;
        }
      }
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment