Skip to content

How to show buttons are clicked? #690

Discussion options

You must be logged in to vote

Your CSS could look something like this:

.main__button-single {
  min-width: 40px;
  min-height: 20px;
  font-size: 0.5em;
  color: white;
  border-color: white;
  border-style: dotted;
}

.darkblue {
  background-color: darkblue;
}

.lightblue {
  background-color: lightblue;
}

You have a class for styling the button except for the background color. That's handled in two new separate classes.
Then, in your App.js you have this:

<button
  type="button"
  className={`main__button-single ${craft === "All" ? "darkblue" : "lightblue"}`}
  aria-label="select all people in Space"
  onClick={() => setCraft("All")}
>
  all
</button>
<button
  type="button"
  className={`main__button-single ${craft 

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Kheirah
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants