1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[4479],{99183:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>a,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>c,toc:()=>d});var n=i(85893),r=i(11151);const s={sidebar_position:31,description:"Styling presets for item-by-item-fn.",toc_max_heading_level:2},o="item-by-item-functions",c={id:"reference/core/item-by-item-functions",title:"item-by-item-functions",description:"Styling presets for item-by-item-fn.",source:"@site/docs/reference/core/item-by-item-functions.mdx",sourceDirName:"reference/core",slug:"/reference/core/item-by-item-functions",permalink:"/docs/reference/core/item-by-item-functions",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:31,frontMatter:{sidebar_position:31,description:"Styling presets for item-by-item-fn.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"past-progressive-faded",permalink:"/docs/reference/core/past-progressive-faded"},next:{title:"item-by-item-fn",permalink:"/docs/reference/core/item-by-item-fn"}},a={},d=[];function l(e){const t={a:"a",br:"br",code:"code",h1:"h1",li:"li",p:"p",ul:"ul",...(0,r.a)(),...e.components},{Signature:i,SignatureName:s,SourceLink:o}=t;return i||p("Signature",!0),s||p("SignatureName",!0),o||p("SourceLink",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"item-by-item-functions",children:"item-by-item-functions"}),"\n",(0,n.jsx)(i,{children:(0,n.jsxs)("code",{children:[(0,n.jsx)(s,{children:"item-by-item-functions"}),(0,n.jsx)(o,{href:"https://github.com/touying-typ/touying/blob/main/src/core.typ#L2379"})]})}),"\n",(0,n.jsx)(t.p,{children:"Styling presets for item-by-item-fn. Available ones are:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"current-bold"}),": Makes the currently revealed item bold. You may pass it an optional ",(0,n.jsx)(t.code,{children:"weight"})," parameter. See ",(0,n.jsx)(t.a,{href:"https://typst.app/docs/reference/text/text/#parameters-weight",children:"https://typst.app/docs/reference/text/text/#parameters-weight"}),". Default is ",(0,n.jsx)(t.code,{children:'"bold"'}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"current-highlight"}),": Highlights the currently revealed item with a yellow background. You may give it an optional ",(0,n.jsx)(t.code,{children:"style"})," parameter (dictionary) to customize the highlight style. See ",(0,n.jsx)(t.a,{href:"https://typst.app/docs/reference/text/highlight/",children:"https://typst.app/docs/reference/text/highlight/"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"past-faded"}),": Fades already revealed items by reducing their fill alpha. You may pass it an optional ",(0,n.jsx)(t.code,{children:"alpha"})," parameter, default is ",(0,n.jsx)(t.code,{children:"20%"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"past-progressive-faded"}),": Fades already revealed items with a progressive fade. You may pass it an optional ",(0,n.jsx)(t.code,{children:"alpha"})," dict. Possible keys are ",(0,n.jsx)(t.code,{children:"linear"})," and ",(0,n.jsx)(t.code,{children:"exponential"})," for linear and exponential fading, respectively. The value is the fading speed. Default is ",(0,n.jsx)(t.code,{children:"(linear: 30%)"}),".\nSee the respective functions for more details."]}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Usage:",(0,n.jsx)(t.br,{}),"\n",(0,n.jsx)(t.code,{children:'#item-by-item-fn("current-highlight")[ ... ]'})," ",(0,n.jsx)(t.br,{}),"\n","or if you want to customize the style: ",(0,n.jsx)(t.br,{}),"\n",(0,n.jsx)(t.code,{children:'#item-by-item-fn(item-by-item-functions.at("current-highlight").with(style: (stroke: red)))[ ... ]'})," or ",(0,n.jsx)(t.br,{}),"\n",(0,n.jsx)(t.code,{children:"#item-by-item-fn((item-by-item-functions.current-highlight).with(style: (stroke: red)))[ ... ]"})]})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(l,{...e})}):l(e)}function p(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,t,i)=>{i.d(t,{Z:()=>c,a:()=>o});var n=i(67294);const r={},s=n.createContext(r);function o(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),n.createElement(s.Provider,{value:t},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.