mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-18 03:26:36 +00:00
chore: use truncate mixins
This commit is contained in:
parent
b63a076059
commit
0aa38ec81a
5 changed files with 7 additions and 7 deletions
|
@ -1,6 +1,6 @@
|
|||
# Component Index
|
||||
|
||||
> 164 components exported from carbon-components-svelte@0.82.7.
|
||||
> 165 components exported from carbon-components-svelte@0.82.7.
|
||||
|
||||
## Components
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"total": 164,
|
||||
"total": 165,
|
||||
"components": [
|
||||
{
|
||||
"moduleName": "Accordion",
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import Preview from "../../components/Preview.svelte";
|
||||
</script>
|
||||
|
||||
This utility component wraps the `.bx--text-truncate--*` CSS selectors from [carbon-components](https://github.com/carbon-design-system/carbon/blob/master/packages/components/src/globals/scss/_helper-classes.scss#L11) for single-line text truncation.
|
||||
This utility component wraps the `.bx--text-truncate-*` Sass mixins from [@carbon/styles](https://github.com/carbon-design-system/carbon/blob/main/packages/styles/scss/utilities/_text-truncate.scss) for single-line text truncation.
|
||||
|
||||
## Default
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
</script>
|
||||
|
||||
<p
|
||||
class:bx--text-truncate--end="{clamp === 'end'}"
|
||||
class:bx--text-truncate--front="{clamp === 'front'}"
|
||||
class:bx--text-truncate-end="{clamp === 'end'}"
|
||||
class:bx--text-truncate-front="{clamp === 'front'}"
|
||||
{...$$restProps}
|
||||
>
|
||||
<slot />
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* <h1 use:truncate={{ clamp: "front" }}>...</h1>
|
||||
*/
|
||||
export function truncate(node, options = {}) {
|
||||
const prefix = "bx--text-truncate--";
|
||||
const prefix = "bx--text-truncate-";
|
||||
|
||||
function toggleClass(front = false) {
|
||||
const classes = [...node.classList]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue