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

CSS overblown and too opinionated? #13

Open
andykillen opened this issue Oct 5, 2020 · 2 comments
Open

CSS overblown and too opinionated? #13

andykillen opened this issue Oct 5, 2020 · 2 comments

Comments

@andykillen
Copy link
Contributor

andykillen commented Oct 5, 2020

Hey Antony,

I've been taking a look at the CSS and how things work, and think its a bit overblown based on how Svelte works.

example for FacebookAuth.svelte in the CSS section there is this

button.facebook-auth:disabled {
  background-color: grey;
}

However, svelte by design will add a unique css class thus rendering this inefficient.

button:disabled {
  background-color: grey;
}

this code above would perform the same task without extra dross. I'm not suggesting to remove the class from the html, as someone might want to add further styling via a global CSS.

In addition to this, I find its quite opinionated in the way it has to be displayed. Things like the button color, text color and button width for me should be adaptable without having to fork and re-write the base.

Suggesting something like this:

<script>
export let buttonColor = "#ff9900";
</script>
<button style="--button-color: {buttonColor}"><!-- inner code --></button>

<style>
button {
  background: var(--button-color);
}
</style>

As I said, I'd rather not fork this so I can continue to get updates if there are any, so I'm thinking there should be 4 new attributes

  1. buttonColor
  2. disabledButtonColor
  3. buttonWidth
  4. textColor

Before I make a PR with this, I just wanted to run it by you to see what your thoughts are?

@harry-herskowitz
Copy link

Even better, no css!

@antony
Copy link
Member

antony commented Nov 1, 2021

We could separate the CSS out, or pass style variables. Probably the latter!

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

No branches or pull requests

3 participants