-
Notifications
You must be signed in to change notification settings - Fork 35
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
Table style customizations #337
Comments
Due to the way Svelte scopes its styles, you have to specifically opt out of scoping for your styles to reach the components of Attractions. Try the following: <style lang="scss">
-.my-table {
+.my-table :global {
td {
border:none;
}
}
</style>
<Table class="my-table" ... /> |
Unfortunately that doesn't work either in my component... Full code here:
|
If I place the style code inside the global.scss instead of inline into my component it works though. Any ideas? |
Oh, wait, sorry, I misled you there a bit. The <script lang="ts">
import { Table } from 'attractions';
const headers = [
{ text: 'First Name', value: 'firstName' },
{ text: 'Last Name', value: 'lastName' },
{ text: 'Age', value: 'age', align: 'end' },
];
const items = [
{ firstName: 'John', lastName: 'Doe', age: 694 },
{ firstName: 'Leo', lastName: 'Tolstoy', age: new Date().getFullYear() - 1828 },
{ firstName: 'فلان', lastName: 'الفلاني', age: 42 },
{ firstName: 'Иван', lastName: 'Иванов', age: 69 },
];
</script>
<style lang="scss">
.something-local :global .my-table {
td {
border: none !important;
}
}
</style>
<div class="something-local">
<Table {headers} {items} alternatingRows={false} class="my-table" />
</div> Note the usage of |
Perfect! It works this way, thank you very much! |
What is the best way to change the styles of the table internal elements? For example change the
thead
background-color or remove the border fromtd
?I've tried overriding them with:
and
but neither works.
The text was updated successfully, but these errors were encountered: