webpack/test/configCases/css/css-modules/use-style.js

56 lines
2.4 KiB
JavaScript
Raw Normal View History

2021-12-15 15:34:31 +08:00
import * as style from "./style.module.css";
import { local1, local2, local3, local4, ident } from "./style.module.css";
2023-06-20 00:37:37 +08:00
import { myCssClass } from "./style.module.my-css";
2023-06-21 04:40:47 +08:00
import * as notACssModule from "./style.module.css.invalid";
import { UsedClassName } from "./identifiers.module.css";
2023-06-21 04:40:47 +08:00
// To prevent analysis export
const isNotACSSModule = typeof notACssModule["c" + "lass"] === "undefined";
2024-02-18 20:33:33 +08:00
const hasOwnProperty = (obj, p) => Object.hasOwnProperty.call(obj, p)
2021-12-15 15:34:31 +08:00
export default {
global: style.global,
2021-12-15 15:34:31 +08:00
class: style.class,
local: `${local1} ${local2} ${local3} ${local4}`,
local2: `${style.local5} ${style.local6}`,
nested: `${style.nested1} ${style.nested2} ${style.nested3}`,
notWmultiParams: `${style.local7}`,
2023-03-27 16:11:53 +08:00
isWmultiParams: `${style.local8}`,
matchesWmultiParams: `${style.local9}`,
whereWmultiParams: `${style.local10}`,
hasWmultiParams: `${style.local11}`,
currentWmultiParams: `${style.local12}`,
pastWmultiParams: `${style.local13}`,
futureWmultiParams: `${style.local14}`,
mozAnyWmultiParams: `${style.local15}`,
webkitAnyWmultiParams: `${style.local16}`,
ident,
keyframes: style.localkeyframes,
2023-04-06 07:09:08 +08:00
keyframesUPPERCASE: style.localkeyframesUPPERCASE,
localkeyframes2UPPPERCASE: style.localkeyframes2UPPPERCASE,
animation: style.animation,
vars: `${style["local-color"]} ${style.vars} ${style["global-color"]} ${style.globalVars}`,
media: style.wideScreenClass,
mediaWithOperator: style.narrowScreenClass,
supports: style.displayGridInSupports,
supportsWithOperator: style.floatRightInNegativeSupports,
mediaInSupports: style.displayFlexInMediaInSupports,
supportsInMedia: style.displayFlexInSupportsInMedia,
2023-04-06 07:09:08 +08:00
displayFlexInSupportsInMediaUpperCase: style.displayFlexInSupportsInMediaUpperCase,
VARS: `${style["LOCAL-COLOR"]} ${style.VARS} ${style["GLOBAL-COLOR"]} ${style.globalVarsUpperCase}`,
2023-04-17 20:14:40 +08:00
inSupportScope: style.inSupportScope,
animationName: style.animationName,
2023-04-13 01:46:19 +08:00
mozAnimationName: style.mozAnimationName,
2023-05-04 20:26:00 +08:00
myColor: style['my-color'],
paddingSm: style['padding-sm'],
paddingLg: style['padding-lg'],
2023-05-05 00:18:13 +08:00
inLocalGlobalScope: style['in-local-global-scope'],
classLocalScope: style['class-local-scope'],
classInContainer: style['class-in-container'],
deepClassInContainer: style['deep-class-in-container'],
2023-06-20 00:37:37 +08:00
cssModuleWithCustomFileExtension: myCssClass,
notAValidCssModuleExtension: isNotACSSModule,
2024-02-18 20:33:33 +08:00
UsedClassName,
exportLocalVarsShouldCleanup: `${hasOwnProperty(notACssModule, 'local-color')} ${hasOwnProperty(notACssModule, "LOCAL-COLOR")}`
2021-12-15 15:34:31 +08:00
};