Skip to content

Commit

Permalink
refactor: use class instead of className
Browse files Browse the repository at this point in the history
  • Loading branch information
buhodev authored Jun 22, 2023
1 parent 8caaec8 commit 7e3697b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ Chessground can be completely restyled through CSS. The component imports defaul
}
</style>

2. Apply your own full chessground stylesheet instead of the defaults by setting the `className` prop and importing your own stylesheet.
2. Apply your own full chessground stylesheet instead of the defaults by setting the `class` prop and importing your own stylesheet.
By changing the class name from the default, none of the default stylesheets will apply, not even the piece SVGs.
Additionally, you can use the provided `ChessgroundUnstyled` component, which is completely unstyled.

<script>
import {ChessgroundUnstyled} from 'svelte-chessground';
import '$lib/my-chessboard.css';
</script>
<ChessgroundUnstyled className="my-chessboard" />
<ChessgroundUnstyled class="my-chessboard" />

You can find working code for both approaches in the [custom styles examples](https://github.com/gtim/svelte-chessground-examples/blob/main/src/routes/style/%2Bpage.svelte).

Expand Down
3 changes: 2 additions & 1 deletion src/lib/Chessground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
* stylesheet than the default.
* @type {string}
*/
export let className = 'cg-default-style';
let className = 'cg-default-style';
export { className as class };
/**
* Chess position in Forsyth-Edwards notation.
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ChessgroundUnstyled.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
* stylesheet than the default.
* @type {string}
*/
export let className = 'cg-default-style';
let className = 'cg-default-style';
export { className as class };
/**
* Chess position in Forsyth-Edwards notation.
Expand Down

0 comments on commit 7e3697b

Please sign in to comment.