omahaproject18 / wordpress-theme

This is the WordPress theme for Tech Omaha's Project 18
2 stars 2 forks source link

Create Toggle Component #5

Open splitinfinities opened 6 years ago

splitinfinities commented 6 years ago

We need to make a toggle component.

How to:

  1. Download the repo, Install node and npm, then, in terminal at the repo's directory, do npm run dev. This should open your browser and let you start coding!
  2. In the components folder, duplicate the "theme" folder and call it "toggle".
  3. Rename all files inside to "toggle.tsx" or "toggle.scss"
  4. Update the tag value in the @Component to "techomaha-toggle"
  5. Update the style value in the @Component to "toggle.scss"
  6. Update the class name to "Toggle"
  7. Update the scss file. We can optimize everything later, just do your best to make a select dropdown!

If you get lost, here it the documentation for Stencil: https://stenciljs.com/docs/intro/

And do not hesitate to reach out to @splitinfinities if you have any questions at all.

We'll use it by writing html:

<techomaha-toggle search value="blah">
    <techomaha-toggle-option value="blah1" />
    <techomaha-toggle-option value="blah2" />
    <techomaha-toggle-option value="blah3" />
</techomaha-toggle>

Property of type (radio||checkbox)

ciprianna commented 6 years ago

40 PR