版博士V2.0程序
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 

59 行
1.8 KiB

  1. 'use strict';
  2. var createPlugin = function (plugin, config) {
  3. return {
  4. handler: plugin,
  5. config: config,
  6. };
  7. };
  8. createPlugin.withOptions = function (pluginFunction, configFunction) {
  9. if (configFunction === void 0) { configFunction = function () { return ({}); }; }
  10. var optionsFunction = function (options) {
  11. if (options === void 0) { options = {}; }
  12. return {
  13. __options: options,
  14. handler: pluginFunction(options),
  15. config: configFunction(options),
  16. };
  17. };
  18. optionsFunction.__isOptionsFunction = true;
  19. // Expose plugin dependencies so that `object-hash` returns a different
  20. // value if anything here changes, to ensure a rebuild is triggered.
  21. optionsFunction.__pluginFunction = pluginFunction;
  22. optionsFunction.__configFunction = configFunction;
  23. return optionsFunction;
  24. };
  25. var index = createPlugin(function (_a) {
  26. var addDynamic = _a.addDynamic, theme = _a.theme;
  27. addDynamic('line-clamp', function (_a) {
  28. var Utility = _a.Utility, Property = _a.Property, Style = _a.Style;
  29. if (Utility.amount === 'none')
  30. return Style(Utility.class, Property('-webkit-line-clamp', 'unset'));
  31. var value = Utility.handler.handleStatic(theme('lineClamp')).handleNumber(1, undefined, 'int').value;
  32. if (value) {
  33. return Style.generate(Utility.class, {
  34. overflow: 'hidden',
  35. display: '-webkit-box',
  36. '-webkit-box-orient': 'vertical',
  37. '-webkit-line-clamp': value,
  38. });
  39. }
  40. }, {
  41. group: 'lineClamp',
  42. completions: [
  43. 'line-clamp-none',
  44. 'line-clamp-{int}',
  45. ],
  46. });
  47. }, {
  48. theme: {
  49. lineClamp: {},
  50. },
  51. variants: {
  52. lineClamp: ['responsive'],
  53. },
  54. });
  55. module.exports = index;