UNPKG

glamor-tachyons

Version:

A tool for using Tacyhons with glamor or other css-in-js libraries

24 lines (17 loc) 510 B
'use strict' exports.hasClass = function (selector) { return /^\.\S+/.test(selector) } exports.isClassSelector = function (selector) { return /^\.[^.# ]+$/.test(selector) } var atRuleRegExp = /^\.?(.*)-([nsml]{1,2})$/ exports.getAtRuleSize = function (selector) { return selector.replace(atRuleRegExp, '$2') } exports.stripAtRuleSize = function (selector) { return selector.replace(atRuleRegExp, '$1') } exports.getPseudos = function (selector) { return selector.replace(/^[^:]*(.*)$/, '$1') }