mirror of
https://github.com/slidevjs/rough-notation.git
synced 2026-01-24 14:00:27 +01:00
feat: support custom class
This commit is contained in:
@@ -74,7 +74,7 @@ class RoughAnnotationImpl implements RoughAnnotation {
|
|||||||
if (this._state === 'unattached' && this._e.parentElement) {
|
if (this._state === 'unattached' && this._e.parentElement) {
|
||||||
ensureKeyframes();
|
ensureKeyframes();
|
||||||
const svg = this._svg = document.createElementNS(SVG_NS, 'svg');
|
const svg = this._svg = document.createElementNS(SVG_NS, 'svg');
|
||||||
svg.setAttribute('class', 'rough-annotation');
|
svg.setAttribute('class', ['rough-annotation', this._config.class || ''].filter(Boolean).join(' '));
|
||||||
const style = svg.style;
|
const style = svg.style;
|
||||||
style.position = 'absolute';
|
style.position = 'absolute';
|
||||||
style.top = '0';
|
style.top = '0';
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ export interface RoughAnnotationConfigBase {
|
|||||||
padding?: RoughPadding; // defaults to 5px
|
padding?: RoughPadding; // defaults to 5px
|
||||||
iterations?: number; // defaults to 2
|
iterations?: number; // defaults to 2
|
||||||
brackets?: BracketType | BracketType[]; // defaults to 'right'
|
brackets?: BracketType | BracketType[]; // defaults to 'right'
|
||||||
|
// Additional class added to the annotation
|
||||||
|
class?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface RoughAnnotation extends RoughAnnotationConfigBase {
|
export interface RoughAnnotation extends RoughAnnotationConfigBase {
|
||||||
|
|||||||
Reference in New Issue
Block a user