PageSourceSearch

https://touying-typ.github.io/assets/js/555c89f3.1010d3f2.js

js touying-typ.github.io collected 2026-10-03 10:06:46 UTC 5,640 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2257],{52468:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>s,contentTitle:()=>c,default:()=>d,frontMatter:()=>r,metadata:()=>l,toc:()=>o});var a=t(85893),i=t(11151);const r={sidebar_position:36,description:"Cover content with an alpha-changing mechanism.",toc_max_heading_level:2},c="alpha-changing-cover",l={id:"reference/utils/alpha-changing-cover",title:"alpha-changing-cover",description:"Cover content with an alpha-changing mechanism.",source:"@site/docs/reference/utils/alpha-changing-cover.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/alpha-changing-cover",permalink:"/docs/reference/utils/alpha-changing-cover",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:36,frontMatter:{sidebar_position:36,description:"Cover content with an alpha-changing mechanism.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"color-changing-cover",permalink:"/docs/reference/utils/color-changing-cover"},next:{title:"alert-with-primary-color",permalink:"/docs/reference/utils/alert-with-primary-color"}},s={},o=[{value:"alpha : <TypeLink></TypeLink> <Default><code>25%</code></Default>",id:"alpha",level:3},{value:"fallback-hide : <TypeLink></TypeLink> <Default><code>hide</code></Default>",id:"fallback-hide",level:3},{value:"transparentize-table : <TypeLink></TypeLink> <Default><code>false</code></Default>",id:"transparentize-table",level:3},{value:"it : <TypeLink></TypeLink>",id:"it",level:3},{value:"fallback-hide-args : <TypeLink></TypeLink> <Default><code>(:)</code></Default>",id:"fallback-hide-args",level:3}];function h(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,i.a)(),...e.components},{Default:t,Param:r,Parameters:c,Signature:l,SignatureName:s,SignatureParam:o,SourceLink:h,TypeLink:d}=n;return t||p("Default",!0),r||p("Param",!0),c||p("Parameters",!0),l||p("Signature",!0),s||p("SignatureName",!0),o||p("SignatureParam",!0),h||p("SourceLink",!0),d||p("TypeLink",!0),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.h1,{id:"alpha-changing-cover",children:"alpha-changing-cover"}),"\n",(0,a.jsx)(l,{children:(0,a.jsxs)("code",{children:[(0,a.jsx)(s,{children:"alpha-changing-cover"}),"(",(0,a.jsxs)(o,{children:[(0,a.jsx)(n.a,{href:"#self",children:"self: none"}),", "]}),(0,a.jsxs)(o,{children:[(0,a.jsx)(n.a,{href:"#alpha",children:"alpha: 25%"}),", "]}),(0,a.jsxs)(o,{children:[(0,a.jsx)(n.a,{href:"#fallback-hide",children:"fallback-hide: hide"}),", "]}),(0,a.jsxs)(o,{children:[(0,a.jsx)(n.a,{href:"#transparentize-table",children:"transparentize-table: false"}),", "]}),(0,a.jsxs)(o,{children:[(0,a.jsx)(n.a,{href:"#fallback-hide-args",children:"fallback-hide-args: (:)"}),", "]}),(0,a.jsx)(o,{children:(0,a.jsx)(n.a,{href:"#it",children:"it"})}),")",(0,a.jsx)(h,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L1593"})]})}),"\n",(0,a.jsx)(n.p,{children:"Cover content with an alpha-changing mechanism."}),"\n",(0,a.jsxs)(n.p,{children:["Example: ",(0,a.jsx)(n.code,{children:"config-methods(cover: utils.alpha-changing-cover.with(alpha: 25%))"})]}),"\n",(0,a.jsxs)(c,{children:[(0,a.jsxs)(n.h3,{id:"alpha",children:["alpha : ",(0,a.jsx)(d,{type:"ratio"})," ",(0,a.jsx)(t,{children:(0,a.jsx)(n.code,{children:"25%"})})]}),(0,a.jsx)(r,{children:(0,a.jsxs)(n.p,{children:["The opacity to apply to text colors when covered. Default is ",(0,a.jsx)(n.code,{children:"25%"}),"."]})}),(0,a.jsxs)(n.h3,{id:"fallback-hide",children:["fallback-hide : ",(0,a.jsx)(d,{type:"func"})," ",(0,a.jsx)(t,{children:(0,a.jsx)(n.code,{children:"hide"})})]}),(0,a.jsx)(r,{children:(0,a.jsxs)(n.p,{children:["The function to use to hide the content if it does not contain text. Default is typst's own ",(0,a.jsx)(n.code,{children:"hide"}),". You may pass ",(0,a.jsx)(n.code,{children:"none"})," to not hide non-text content. To hide content with a semi-transparent/color overlay, you can pass in ",(0,a.jsx)(n.code,{children:"semi-transparent-cover"}),"/",(0,a.jsx)(n.code,{children:"cover-with-rect.with(fill: ...)"}),"."]})}),(0,a.jsxs)(n.h3,{id:"transparentize-table",children:["transparentize-table : ",(0,a.jsx)(d,{type:"bool"})," ",(0,a.jsx)(t,{children:(0,a.jsx)(n.code,{children:"false"})})]}),(0,a.jsx)(r,{children:(0,a.jsxs)(n.p,{children:["Whether to transparentize table content. Default is ",(0,a.jsx)(n.code,{children:"false"}),"."]})}),(0,a.jsxs)(n.h3,{id:"it",children:["it : ",(0,a.jsx)(d,{type:"content"})]}),(0,a.jsx)(r,{children:(0,a.jsx)(n.p,{children:"The content to cover."})}),(0,a.jsxs)(n.h3,{id:"fallback-hide-args",children:["fallback-hide-args : ",(0,a.jsx)(d,{type:"args"})," ",(0,a.jsx)(t,{children:(0,a.jsx)(n.code,{children:"(:)"})})]}),(0,a.jsx)(r,{children:(0,a.jsx)(n.p,{children:"The arguments to pass to the fallback hide function if the content does not contain text."})})]}),"\n",(0,a.jsxs)(n.p,{children:[(0,a.jsx)(n.strong,{children:"Returns:"})," ",(0,a.jsx)(d,{type:"content"})]})]})}function d(e={}){const{wrapper:n}={...(0,i.a)(),...e.components};return n?(0,a.jsx)(n,{...e,children:(0,a.jsx)(h,{...e})}):h(e)}function p(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,n,t)=>{t.d(n,{Z:()=>l,a:()=>c});var a=t(67294);const i={},r=a.createContext(i);function c(e){const n=a.useContext(r);return a.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),a.createElement(r.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.