Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getting a checked image when selecting a preset swatch #278

Open
ashutosh215 opened this issue Jun 6, 2019 · 4 comments
Open

getting a checked image when selecting a preset swatch #278

ashutosh215 opened this issue Jun 6, 2019 · 4 comments
Labels

Comments

@ashutosh215
Copy link

hi i was wondering if we can get a checked mark on the selected swatch from the preset swatches

@claviska
Copy link
Owner

claviska commented Jun 6, 2019

You can do this in your stylesheet using the following selector:

.minicolors-swatch.selected {
  /* your checkmark styles here */
}

You may want to take advantage of the ::before or ::after pseudo selector to achieve this.

@ashutosh215
Copy link
Author

hey i know its too much to ask but can you please write it for me please. i tried but i failed
i want to add a check mark to the selected swatch

@Bhoft
Copy link

Bhoft commented Nov 5, 2019

Try this:

image

.minicolors-swatch.selected:after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-left: 40%;
  margin-top: 20%;
}

@Bhoft
Copy link

Bhoft commented Nov 5, 2019

Or better using the html code instead of painting with css (solution from above).
https://www.toptal.com/designers/htmlarrows/symbols/check-mark/

image

.minicolors-swatch.selected:after {
    content: "\2713";
    color:black;
    position: relative;
    margin: auto 20%;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants