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

Provide default styles #105

Open
afcapel opened this issue Mar 12, 2022 · 2 comments
Open

Provide default styles #105

afcapel opened this issue Mar 12, 2022 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@afcapel
Copy link
Owner

afcapel commented Mar 12, 2022

All the examples use css from bootstrap v4 to style the results box. While there's little to it, it'd be nicer if we provided a minimal css so the autocomplete is easier to use for folks that don't use bootstrap.

An example using Tailwind would be nice too.

If we implement multi selection (as per #53 (comment)), the styling would be more involved and having a foundation in place would be useful.

@afcapel afcapel added enhancement New feature or request good first issue Good for newcomers labels Mar 12, 2022
@brentgreeff
Copy link

If anyone has some basic CSS they can paste here - would be most appreciated.

This project is pretty amazing - very easy to get going, and then you hit the CSS and have to use the inspector to figure it out.

@brentgreeff
Copy link

Here is some

[data-controller=autocomplete] {
  margin: 1em;

  .list-group {
    margin: 0;
    padding: 0;
  }

  .list-group-item {
    position: relative;
    display: block;
    padding: 0.75rem 1.25rem;
    margin-bottom: -1px;
    background-color: #fff;
    border: 1px solid rgba(0,0,0,.125);
    width: 30em;

    &:hover {
      z-index: 2;
      color: #fff;
      background-color: #007bff;
      border-color: #007bff;
    }
  }

  .list-group-item.active {
    z-index: 2;
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
  }

  .list-group-item:first-child {
    border-top-left-radius: 0.25rem;
    border-top-right-radius: 0.25rem;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants