tailwindcss 0.0.0-oxide-insiders.20c39a9 → 0.0.0-oxide-insiders.afd159d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -926,21 +926,40 @@ function registerPlugins(plugins, context) {
926
926
  };
927
927
  // Generate a list of strings for autocompletion purposes, e.g.
928
928
  // ['uppercase', 'lowercase', ...]
929
- context.getClassList = function getClassList() {
929
+ context.getClassList = function getClassList(options = {}) {
930
930
  let output = [];
931
931
  for (let util of classList){
932
932
  if (Array.isArray(util)) {
933
- let [utilName, options] = util;
933
+ var _utilOptions_types;
934
+ let [utilName, utilOptions] = util;
934
935
  let negativeClasses = [];
935
- var _options_values;
936
- for (let [key, value] of Object.entries((_options_values = options === null || options === void 0 ? void 0 : options.values) !== null && _options_values !== void 0 ? _options_values : {})){
936
+ var _utilOptions_modifiers;
937
+ let modifiers = Object.keys((_utilOptions_modifiers = utilOptions === null || utilOptions === void 0 ? void 0 : utilOptions.modifiers) !== null && _utilOptions_modifiers !== void 0 ? _utilOptions_modifiers : {});
938
+ if (utilOptions === null || utilOptions === void 0 ? void 0 : (_utilOptions_types = utilOptions.types) === null || _utilOptions_types === void 0 ? void 0 : _utilOptions_types.some(({ type })=>type === "color")) {
939
+ var _context_tailwindConfig_theme_opacity;
940
+ modifiers.push(...Object.keys((_context_tailwindConfig_theme_opacity = context.tailwindConfig.theme.opacity) !== null && _context_tailwindConfig_theme_opacity !== void 0 ? _context_tailwindConfig_theme_opacity : {}));
941
+ }
942
+ let metadata = {
943
+ modifiers
944
+ };
945
+ let includeMetadata = options.includeMetadata && modifiers.length > 0;
946
+ var _utilOptions_values;
947
+ for (let [key, value] of Object.entries((_utilOptions_values = utilOptions === null || utilOptions === void 0 ? void 0 : utilOptions.values) !== null && _utilOptions_values !== void 0 ? _utilOptions_values : {})){
937
948
  // Ignore undefined and null values
938
949
  if (value == null) {
939
950
  continue;
940
951
  }
941
- output.push((0, _nameClass.formatClass)(utilName, key));
942
- if ((options === null || options === void 0 ? void 0 : options.supportsNegativeValues) && (0, _negateValue.default)(value)) {
943
- negativeClasses.push((0, _nameClass.formatClass)(utilName, `-${key}`));
952
+ let cls = (0, _nameClass.formatClass)(utilName, key);
953
+ output.push(includeMetadata ? [
954
+ cls,
955
+ metadata
956
+ ] : cls);
957
+ if ((utilOptions === null || utilOptions === void 0 ? void 0 : utilOptions.supportsNegativeValues) && (0, _negateValue.default)(value)) {
958
+ let cls = (0, _nameClass.formatClass)(utilName, `-${key}`);
959
+ negativeClasses.push(includeMetadata ? [
960
+ cls,
961
+ metadata
962
+ ] : cls);
944
963
  }
945
964
  }
946
965
  output.push(...negativeClasses);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwindcss",
3
- "version": "0.0.0-oxide-insiders.20c39a9",
3
+ "version": "0.0.0-oxide-insiders.afd159d",
4
4
  "description": "A utility-first CSS framework for rapidly building custom user interfaces.",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
@@ -70,7 +70,7 @@
70
70
  "postcss": "^8.0.9"
71
71
  },
72
72
  "dependencies": {
73
- "@tailwindcss/oxide": "0.0.0-oxide-insiders.20c39a9",
73
+ "@tailwindcss/oxide": "0.0.0-oxide-insiders.afd159d",
74
74
  "arg": "^5.0.2",
75
75
  "browserslist": "^4.21.4",
76
76
  "chokidar": "^3.5.3",
@@ -962,23 +962,35 @@ function registerPlugins(plugins, context) {
962
962
 
963
963
  // Generate a list of strings for autocompletion purposes, e.g.
964
964
  // ['uppercase', 'lowercase', ...]
965
- context.getClassList = function getClassList() {
965
+ context.getClassList = function getClassList(options = {}) {
966
966
  let output = []
967
967
 
968
968
  for (let util of classList) {
969
969
  if (Array.isArray(util)) {
970
- let [utilName, options] = util
970
+ let [utilName, utilOptions] = util
971
971
  let negativeClasses = []
972
972
 
973
- for (let [key, value] of Object.entries(options?.values ?? {})) {
973
+ let modifiers = Object.keys(utilOptions?.modifiers ?? {})
974
+
975
+ if (utilOptions?.types?.some(({ type }) => type === 'color')) {
976
+ modifiers.push(...Object.keys(context.tailwindConfig.theme.opacity ?? {}))
977
+ }
978
+
979
+ let metadata = { modifiers }
980
+ let includeMetadata = options.includeMetadata && modifiers.length > 0
981
+
982
+ for (let [key, value] of Object.entries(utilOptions?.values ?? {})) {
974
983
  // Ignore undefined and null values
975
984
  if (value == null) {
976
985
  continue
977
986
  }
978
987
 
979
- output.push(formatClass(utilName, key))
980
- if (options?.supportsNegativeValues && negateValue(value)) {
981
- negativeClasses.push(formatClass(utilName, `-${key}`))
988
+ let cls = formatClass(utilName, key)
989
+ output.push(includeMetadata ? [cls, metadata] : cls)
990
+
991
+ if (utilOptions?.supportsNegativeValues && negateValue(value)) {
992
+ let cls = formatClass(utilName, `-${key}`)
993
+ negativeClasses.push(includeMetadata ? [cls, metadata] : cls)
982
994
  }
983
995
  }
984
996