aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/core/textable.js
blob: 55df7c6c906ee8384457a6789f82c526ef66cc92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { globals } from '../../utils/window.js'

// Create plain text node
export function plain (text) {
  // clear if build mode is disabled
  if (this._build === false) {
    this.clear()
  }

  // create text node
  this.node.appendChild(globals.document.createTextNode(text))

  return this
}

// Get length of text element
export function length () {
  return this.node.getComputedTextLength()
}