chore(docs): Add Howto hide paths but show text
This commit is contained in:
parent
7e8eb9d71e
commit
8901473237
1 changed files with 28 additions and 0 deletions
28
markdown/dev/howtos/code/hide-paths-show-text/en.md
Normal file
28
markdown/dev/howtos/code/hide-paths-show-text/en.md
Normal file
|
@ -0,0 +1,28 @@
|
|||
---
|
||||
title: Hide paths but still show text
|
||||
|
||||
---
|
||||
|
||||
To hide a path but have its text still shown, add the `hidden` CSS class
|
||||
to the path's attributes.
|
||||
|
||||
You can do this via different methods:
|
||||
1. [`Path.attr()`](/reference/api/path/attr)
|
||||
2. [`Path.addClass()`](/reference/api/path/addclass)
|
||||
3. [`Path.setclass()`](/reference/api/path/setclass)
|
||||
|
||||
```mjs
|
||||
path1.attr('class', 'hidden')
|
||||
path2.addClass('hidden')
|
||||
path3.setClass('hidden')
|
||||
```
|
||||
|
||||
Setting the `hidden` CSS class causes the path to be invisible but
|
||||
still included in the drafted pattern. Because the CSS classes for the
|
||||
text are independent from the CSS classes for the path, the text
|
||||
will still appear even though the path is invisible.
|
||||
|
||||
(Hiding a path via `Path.hide()` or `Path.setHidden()` will not work
|
||||
for this purpose.
|
||||
These methods will cause both the path and its accompanying text to be
|
||||
omitted when the pattern is drafted.)
|
Loading…
Add table
Add a link
Reference in a new issue