How to use stylehacks - 8 common examples

To help you get started, we’ve selected a few stylehacks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stylelint / stylelint / src / rules / no-browser-hacks / index.js View on Github external
const validOptions = validateOptions(result, ruleName, { actual: on }, {
      optional: true,
      actual: options,
      possible: {
        browsers: [isString],
      },
    })
    if (!validOptions) { return }

    const stylehacksOptions = { lint: true }
    if (options && options.browsers) {
      stylehacksOptions.browsers = options.browsers
    }

    const stylehacksResult = new Result()
    stylehacks(stylehacksOptions)(root, stylehacksResult)
    stylehacksResult.warnings().forEach(stylehacksWarning => {
      const message = messages.rejected(stylehacksWarning.identifier, stylehacksWarning.hack)
      report({
        ruleName,
        result,
        message,
        node: stylehacksWarning.node,
        line: stylehacksWarning.line,
        column: stylehacksWarning.column,
      })
    })
  }
}

stylehacks

Detect/remove browser hacks from CSS files.

MIT
Latest version published 1 month ago

Package Health Score

97 / 100
Full package analysis

Popular stylehacks functions