You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

createStyleSheet.js 696B

123456789101112131415161718192021222324
  1. import { shimStyles } from './shimStyles';
  2. /**
  3. * Create a style sheet using the provided style definitions.
  4. *
  5. * @param {Object} styles - A dictionary of named style definitions.
  6. * @param {Object} [overrides={}] - Optional set of additional (often
  7. * platform-dependent/specific) style definitions that will override the base
  8. * (often platform-independent) styles.
  9. * @returns {Object}
  10. */
  11. export function createStyleSheet(styles, overrides = {}) {
  12. const combinedStyles = {};
  13. for (const k of Object.keys(styles)) {
  14. combinedStyles[k]
  15. = shimStyles({
  16. ...styles[k],
  17. ...overrides[k]
  18. });
  19. }
  20. return combinedStyles;
  21. }