{"record":{"id":"4da420586fde51bb","repo":"swc-project/swc","slug":"boolean-logic-in-custom-media-at-rules-is-not-sup","errorCode":null,"errorMessage":"Boolean logic in @custom-media at-rules is not supported by swc","messagePattern":"Boolean logic in @custom-media at-rules is not supported by swc","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/swc_css_compat/src/compiler/custom_media.rs","lineNumber":242,"sourceCode":"        }\n    }\n\n    pub(crate) fn process_media_in_parens(&mut self, n: &MediaInParens) -> Option<MediaInParens> {\n        if let Some(MediaFeatureBoolean {\n            name: MediaFeatureName::ExtensionName(name),\n            ..\n        }) = n.as_feature().and_then(|feature| feature.as_boolean())\n        {\n            if let Some(custom_media) = self.medias.iter().find(|m| m.name.value == name.value) {\n                let mut new_media_condition = MediaCondition {\n                    span: DUMMY_SP,\n                    conditions: Vec::new(),\n                };\n\n                let queries = match &custom_media.media {\n                    CustomMediaQueryMediaType::Ident(_) => {\n                        // TODO make me warning, we should keep code as is in such cases\n                        unimplemented!(\n                            \"Boolean logic in @custom-media at-rules is not supported by swc\"\n                        );\n                    }\n                    CustomMediaQueryMediaType::MediaQueryList(media_query_list) => {\n                        &media_query_list.queries\n                    }\n                };\n\n                for query in queries {\n                    if query.media_type.is_some() || query.modifier.is_some() {\n                        // TODO throw a warning on multiple media types\n                        self.modifier_and_media_type =\n                            Some((query.modifier.clone(), query.media_type.clone()));\n                    }\n\n                    if let Some(condition) = &query.condition {\n                        match &**condition {\n                            MediaConditionType::All(media_condition) => {","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/swc-project/swc/blob/5176682b65416c6b5de6b47379ae1588ea3ecb3f/crates/swc_css_compat/src/compiler/custom_media.rs#L224-L260","documentation":"A capability guard in the @custom-media processing pass (swc_css_compat custom_media.rs:242). When a media query references a custom media whose definition contains boolean logic (and/or/not over custom media), the pass attempts to splice that logic into the referencing query; splicing arbitrary boolean conditions is not supported by swc's implementation, so the pass aborts with this marker when it would need to inline such a condition.","triggerScenarios":"Thrown at crates/swc_css_compat/src/compiler/custom_media.rs:242 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the @custom-media definition to avoid boolean logic (single custom media per definition)","Inline the media condition manually in the stylesheet instead of relying on @custom-media","Check for a swc_css_compat version that supports boolean-logic custom media splicing"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5176682b65416c6b5de6b47379ae1588ea3ecb3f","analyzedAt":"2026-08-17T16:16:52.067Z","contentChangedAt":"2026-08-17T16:16:52.067Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}