1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- "use strict";
- exports.__esModule = true;
- exports["default"] = buttons;
- var _statefulSelectors = _interopRequireDefault(require("../internalHelpers/_statefulSelectors"));
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
- var stateMap = [undefined, null, 'active', 'focus', 'hover'];
- function template(state) {
- return "button" + state + ",\n input[type=\"button\"]" + state + ",\n input[type=\"reset\"]" + state + ",\n input[type=\"submit\"]" + state;
- }
- /**
- * Populates selectors that target all buttons. You can pass optional states to append to the selectors.
- * @example
- * // Styles as object usage
- * const styles = {
- * [buttons('active')]: {
- * 'border': 'none'
- * }
- * }
- *
- * // styled-components usage
- * const div = styled.div`
- * > ${buttons('active')} {
- * border: none;
- * }
- * `
- *
- * // CSS in JS Output
- *
- * 'button:active,
- * 'input[type="button"]:active,
- * 'input[type=\"reset\"]:active,
- * 'input[type=\"submit\"]:active: {
- * 'border': 'none'
- * }
- */
- function buttons() {
- for (var _len = arguments.length, states = new Array(_len), _key = 0; _key < _len; _key++) {
- states[_key] = arguments[_key];
- }
- return (0, _statefulSelectors["default"])(states, template, stateMap);
- }
- module.exports = exports.default;
|