The cwrapOmit is a very powerful versatile directive used to prevent the final rendering of elements or key-value pairs from their appearance.
In this example it will prevent from adding any class to current element in other words it will remove whole class attribute. It works a little bit different than cwrapPlaceholder directive that will be described on next documentation page.
{ "attributes": { "href": "cwrapProperty[prefixAside=../]cwrapGlobal[documentation.advanced concepts.cwrapIndex]/", "class": "cwrapArray[{{return cwrapReference.globals.const.documentation['advanced concepts'].map((x) => x !== cwrapRoute.replace('documentation/','') ? 'cwrapOmit' : 'focus')}}]" } }
In here by default, the property 'script' has the value 'script', resulting in the script element being rendered. However, if replaced with 'cwrapOmit', it will prevent this element from being rendered in the final DOM.
{ "element": "cwrapProperty[script=script]", "attributes": { "type": "module", "src": "cwrapProperty[prefix=./]static/scripts/cwrapProperty[scriptSource=home.js]" } }
In this example, when 'cwrapOmit' is passed as a property into 'hamburgerNavDisplay', it will remove the current 'display: flex' key-value pair, leaving 'margin-left: 1em;' intact.
{ "element": "cwrapProperty[script=script]", "mediaQueries": [ { "query": "max-width: 1024px", "style": "display: cwrapProperty[hamburgerNavDisplay=flex]; margin-left: 1em;" } ], "attributes": { "type": "module", "src": "cwrapProperty[prefix=./]static/scripts/cwrapProperty[scriptSource=home.js]" } }