PHP 8.2.30
Preview: important.js Size: 1.44 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/polished/lib/helpers/important.js

"use strict";

exports.__esModule = true;
exports["default"] = important;
var _errors = _interopRequireDefault(require("../internalHelpers/_errors"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
/**
 * Helper for targeting rules in a style block generated by polished modules that need !important-level specificity. Can optionally specify a rule (or rules) to target specific rules.
 *
 * @example
 * // Styles as object usage
 * const styles = {
 *   ...important(cover())
 * }
 *
 * // styled-components usage
 * const div = styled.div`
 *   ${important(cover())}
 * `
 *
 * // CSS as JS Output
 *
 * div: {
 *   'position': 'absolute !important',
 *   'top': '0 !important',
 *   'right: '0 !important',
 *   'bottom': '0 !important',
 *   'left: '0 !important'
 * }
 */
function important(styleBlock, rules) {
  if (typeof styleBlock !== 'object' || styleBlock === null) {
    throw new _errors["default"](75, typeof styleBlock);
  }
  var newStyleBlock = {};
  Object.keys(styleBlock).forEach(function (key) {
    if (typeof styleBlock[key] === 'object' && styleBlock[key] !== null) {
      newStyleBlock[key] = important(styleBlock[key], rules);
    } else if (!rules || rules && (rules === key || rules.indexOf(key) >= 0)) {
      newStyleBlock[key] = styleBlock[key] + " !important";
    } else {
      newStyleBlock[key] = styleBlock[key];
    }
  });
  return newStyleBlock;
}
module.exports = exports.default;

Directory Contents

Dirs: 0 × Files: 27

Name Size Perms Modified Actions
126 B lrw-r--r-- 2026-02-28 00:31:12
Edit Download
1.29 KB lrw-r--r-- 2026-02-28 00:30:26
Edit Download
1.13 KB lrw-r--r-- 2026-02-28 00:29:06
Edit Download
212 B lrw-r--r-- 2026-02-28 00:31:12
Edit Download
2.58 KB lrw-r--r-- 2026-02-28 00:30:28
Edit Download
2.12 KB lrw-r--r-- 2026-02-28 00:29:10
Edit Download
98 B lrw-r--r-- 2026-02-28 00:31:14
Edit Download
829 B lrw-r--r-- 2026-02-28 00:30:30
Edit Download
638 B lrw-r--r-- 2026-02-28 00:29:14
Edit Download
96 B lrw-r--r-- 2026-02-28 00:31:14
Edit Download
885 B lrw-r--r-- 2026-02-28 00:30:32
Edit Download
817 B lrw-r--r-- 2026-02-28 00:29:22
Edit Download
164 B lrw-r--r-- 2026-02-28 00:31:14
Edit Download
1.44 KB lrw-r--r-- 2026-02-28 00:30:38
Edit Download
1.31 KB lrw-r--r-- 2026-02-28 00:29:36
Edit Download
615 B lrw-r--r-- 2026-02-28 00:31:20
Edit Download
2.05 KB lrw-r--r-- 2026-02-28 00:30:44
Edit Download
1.81 KB lrw-r--r-- 2026-02-28 00:29:44
Edit Download
100 B lrw-r--r-- 2026-02-28 00:31:22
Edit Download
836 B lrw-r--r-- 2026-02-28 00:30:58
Edit Download
645 B lrw-r--r-- 2026-02-28 00:29:54
Edit Download
114 B lrw-r--r-- 2026-02-28 00:31:22
Edit Download
2.05 KB lrw-r--r-- 2026-02-28 00:30:58
Edit Download
1.86 KB lrw-r--r-- 2026-02-28 00:29:54
Edit Download
96 B lrw-r--r-- 2026-02-28 00:31:26
Edit Download
683 B lrw-r--r-- 2026-02-28 00:31:00
Edit Download
634 B lrw-r--r-- 2026-02-28 00:29:58
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).