Sha256: 1a16f193814168ca7c7526133f0eec0526de6eed9c38c105b9c46d76c1101539

Contents?: true

Size: 495 Bytes

Versions: 27

Compression:

Stored size: 495 Bytes

Contents

'use strict'

let Node = require('./node')

class Declaration extends Node {
  constructor(defaults) {
    if (
      defaults &&
      typeof defaults.value !== 'undefined' &&
      typeof defaults.value !== 'string'
    ) {
      defaults = { ...defaults, value: String(defaults.value) }
    }
    super(defaults)
    this.type = 'decl'
  }

  get variable() {
    return this.prop.startsWith('--') || this.prop[0] === '$'
  }
}

module.exports = Declaration
Declaration.default = Declaration

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.25 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.24 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.23 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.22 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.21 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.20 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.19 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.18 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.17 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.16 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.15 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.14 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.13 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.12 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.11 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.10 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.9 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.8 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js
clapton-0.0.7 lib/clapton/javascripts/node_modules/postcss/lib/declaration.js