-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Premade components? #379
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
Comments
I don't think so yet. That would be a great thing to have though. We'd have to have a bit of a think about how to handle things like theming — maybe that would be solved if we had a way of linking to stylesheets from components (as opposed to just having <div class='accordion'>
<!-- ... -->
</div>
<link rel='stylesheet' href='./themes/__USER_THEME__/accordion.css'>
<!-- or... -->
<div class='accordion'>
<!-- ... -->
</div>
<style>
@import ./themes/__USER_THEME__/accordion.css';
</style> |
@shawnhwei I've a start of Bootstrap 4 components, but not released yet. If you are still looking in a week or two please remind and I can share what I have, and perhaps collaborate on this. |
I've added the project start here: https://github.com/bestguy/sveltestrap, and published to npm as 'sveltestrap'. Happy to collaborate with anyone on this if they have a need for this. |
@Rich-Harris Is the @import css option available? |
@praneybehl no, not yet — but if it was, it could be useful for theming |
@Rich-Harris what are your thoughts on adopting css-modules into svelte? If this were to be implemented you could do so via post-css and allow more control over css preprocessing via postcss config. |
It seems to me that Svelte already supports most features one would need for theming out-of-the-box. Take the following HTML : <!doctype html>
<html>
<head>
<meta charset='utf8'>
<meta name='viewport' content='width=device-width'>
<title>Svelte app</title>
<link rel='stylesheet' href='global.css'>
<link rel='stylesheet' href='bundle.css'>
<link rel='stylesheet' href='theme.css'>
</head>
<body class="christmas">
<script src='bundle.js'></script>
</body>
</html> Suppose your <div class="app">Hello {{name}}</div>
<div class="lines">
{{#each lines as line}}
<Line value={{line}}/>
{{/each}}
</div>
<script>
import Line from './Line.html';
export default {
components: {
Line
}
};
</script> And that component imports a component named <div class="line">{{value}}</div>
<style>
.line {
background: #222;
color: #ddd;
}
</style>
<script>
export default {}
</script> Now, suppose .line {
background : #ccc;
color : #000;
} And suppose .christmas .line {
background : #9c9;
color : #e22;
} What's gonna happen, here, is that the selector sets the default for your Next, the Finally, the The only thing missing, really, is a way to overwrite only the For example, assigning the value I would then be able to use the This, I believe, is the only necessary addition to allow theming both at a global level and a component level. As a nice bonus, your DOM also would look prettier and more readable when consistently using semantic names as the See also #570 (comment)! |
Aside from the discussion about css modules and global scoping of css, how is this issue different from #1070? |
Since a google search brought me here, I thought I'd share: Svelma is a Bulma component framework for Svelte 3. A work-in-progress but new components are being added fast. It's very similar to Buefy for Vue. |
Bootstrap 4 components for Svelte v3 : https://github.com/bestguy/sveltestrap |
Check out svelte-community for a bunch if them. |
Does anyone know of any premade component sets or ports of existing frameworks to Svelte (Bootstrap, UIkit, etc.)?
The text was updated successfully, but these errors were encountered: