=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");o.push(a)}else if(l===3||r>1&&l===4){let u=l===4?i.parseULong():i.parseCard16(),c=l===4?i.parseULong():i.parseCard16();if(c!==0)throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${c}`);let p;for(let f=0;f=s)throw new Error("CFF table CID Font FDSelect has bad FD index value "+a+" (FD count "+s+")");if(p>n)throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${p}`);for(;c1?null:Se(e,o.endOffset,b.bytesToString),i=o.formatMajor>1?null:Se(e,a.endOffset),l=o.formatMajor>1?null:Se(e,i.endOffset,b.bytesToString),u=Se(e,o.formatMajor>1?t+o.size+o.topDictLength:l.endOffset,void 0,o.formatMajor);n.gsubrs=u.objects,n.gsubrsBias=_t(n.gsubrs);let c;if(o.formatMajor>1){let f=t+o.size,h=b.getBytes(e,f,f+o.topDictLength);c=Ln(e,0,[h],void 0,o.formatMajor)[0]}else{let f=Ln(e,t,i.objects,l.objects,o.formatMajor);if(f.length!==1)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+f.length);c=f[0]}if(r.topDict=c,c._privateDict&&(n.defaultWidthX=c._privateDict.defaultWidthX,n.nominalWidthX=c._privateDict.nominalWidthX),o.formatMajor<2&&c.ros[0]!==void 0&&c.ros[1]!==void 0&&(n.isCIDFont=!0),o.formatMajor>1){let f=c.fdArray,h=c.fdSelect;if(!f)throw new Error("This is a CFF2 font, but FDArray information is missing");let m=Se(e,t+f,null,o.formatMajor),d=ya(e,t,m.objects);c._fdArray=d,h&&(c._fdSelect=Ps(e,t+h,n.numGlyphs,d.length,o.formatMajor))}else if(n.isCIDFont){let f=c.fdArray,h=c.fdSelect;if(f===0||h===0)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");f+=t;let m=Se(e,f),d=Ln(e,t,m.objects,l.objects,o.formatMajor);c._fdArray=d,h+=t,c._fdSelect=Ps(e,h,n.numGlyphs,d.length,o.formatMajor)}if(o.formatMajor<2){let f=t+c.private[1],h=Pn(e,f,c.private[0],l.objects,o.formatMajor);if(n.defaultWidthX=h.defaultWidthX,n.nominalWidthX=h.nominalWidthX,h.subrs!==0){let m=f+h.subrs,d=Se(e,m);n.subrs=d.objects,n.subrsBias=_t(n.subrs)}else n.subrs=[],n.subrsBias=0}let p;if(s.lowMemory?(p=la(e,t+c.charStrings,o.formatMajor),n.nGlyphs=p.offsets.length-(o.formatMajor>1?1:0)):(p=Se(e,t+c.charStrings,null,o.formatMajor),n.nGlyphs=p.objects.length),o.formatMajor>1&&n.tables.maxp&&n.nGlyphs!==n.tables.maxp.numGlyphs&&console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`),o.formatMajor<2){let f=[],h=[];c.charset===0?f=Us:c.charset===1?f=Is:c.charset===2?f=Rs:f=xa(e,t+c.charset,n.nGlyphs,l.objects,n.isCIDFont),c.encoding===0?h=Bt:c.encoding===1?h=Es:h=ba(e,t+c.encoding),n.cffEncoding=new En(h,f),n.encoding=n.encoding||n.cffEncoding}if(n.glyphs=new ne.GlyphSet(n),s.lowMemory)n._push=function(f){let h=ca(f,p.offsets,e,t+c.charStrings,void 0,o.formatMajor);n.glyphs.push(f,ne.cffGlyphLoader(n,f,wn,h,o.formatMajor))};else for(let f=0;f=0&&(n=s),s=t.indexOf(e),s>=0?n=s+st.length:(n=st.length+t.length,t.push(e)),n}function Ta(){return new x.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function ka(e){let t=new x.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);t.names=[];for(let n=0;n1?Hs:Gs,e,t),s}function Ns(e){let t=new x.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return t.topDicts=[{name:"topDict_0",type:"TABLE",value:e}],t}function Oa(e){let t=new x.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);t.strings=[];for(let n=0;n1?_s:Vs,e,t),s}function Ea(e,t){let s=new x.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/t.unitsPerEm,o={version:t.version,fullName:t.fullName,familyName:t.familyName,weight:t.weightName,fontBBox:t.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},a=t&&t.topDict||{};a.paintType&&(o.paintType=a.paintType,o.strokeWidth=a.strokeWidth||0);let i={},l=[],u;for(let h=1;h=n.begin&&e=1&&(n.ulCodePageRange1=s.parseULong(),n.ulCodePageRange2=s.parseULong()),n.version>=2&&(n.sxHeight=s.parseShort(),n.sCapHeight=s.parseShort(),n.usDefaultChar=s.parseUShort(),n.usBreakChar=s.parseUShort(),n.usMaxContent=s.parseUShort()),n}function Wa(e){return new x.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],e)}var lt={parse:ja,make:Wa,unicodeRanges:Nn,getUnicodeRange:za};function qa(e,t){let n={},s=new b.Parser(e,t);switch(n.version=s.parseVersion(),n.italicAngle=s.parseFixed(),n.underlinePosition=s.parseShort(),n.underlineThickness=s.parseShort(),n.isFixedPitch=s.parseULong(),n.minMemType42=s.parseULong(),n.maxMemType42=s.parseULong(),n.minMemType1=s.parseULong(),n.maxMemType1=s.parseULong(),n.version){case 1:n.names=Ee.slice();break;case 2:n.numberOfGlyphs=s.parseUShort(),n.glyphNameIndex=new Array(n.numberOfGlyphs);for(let r=0;r=Ee.length){let o=s.parseChar();n.names.push(s.parseString(o))}break;case 2.5:n.numberOfGlyphs=s.parseUShort(),n.offset=new Array(n.numberOfGlyphs);for(let r=0;r[{name:"glyphID_"+a,type:"USHORT",value:o.glyphID},{name:"firstLayerIndex_"+a,type:"USHORT",value:o.firstLayerIndex},{name:"numLayers_"+a,type:"USHORT",value:o.numLayers}]).flat(),...n.map((o,a)=>[{name:"LayerGlyphID_"+a,type:"USHORT",value:o.glyphID},{name:"paletteIndex_"+a,type:"USHORT",value:o.paletteIndex}]).flat()])}var Kt={parse:Qa,make:Ja};function ei(e,t){return[{name:"tag_"+e,type:"TAG",value:t.tag},{name:"minValue_"+e,type:"FIXED",value:t.minValue<<16},{name:"defaultValue_"+e,type:"FIXED",value:t.defaultValue<<16},{name:"maxValue_"+e,type:"FIXED",value:t.maxValue<<16},{name:"flags_"+e,type:"USHORT",value:0},{name:"nameID_"+e,type:"USHORT",value:t.axisNameID}]}function ti(e,t,n){let s={},r=new b.Parser(e,t);s.tag=r.parseTag(),s.minValue=r.parseFixed(),s.defaultValue=r.parseFixed(),s.maxValue=r.parseFixed(),r.skip("uShort",1);let o=r.parseUShort();return s.axisNameID=o,s.name=nt(n,o),s}function ni(e,t,n,s={}){let r=[{name:"nameID_"+e,type:"USHORT",value:t.subfamilyNameID},{name:"flags_"+e,type:"USHORT",value:0}];for(let o=0;o1||o>0?s.parseUShort():void 0;n!==void 0&&v.argument(l>=n.axes.length,"STAT axis count must be greater than or equal to fvar axis count"),c>0&&v.argument(l>=0,"STAT axis count must be greater than 0 if STAT axis value count is greater than 0");let h=[];for(let y=0;yi.value.tag?1:-1}),t.fields=t.fields.concat(s),t.fields=t.fields.concat(r),t}function $s(e,t,n){for(let s=0;s0)return e.glyphs.get(r).getMetrics()}return n}function Oi(e){let t=0;for(let n=0;nae||l===void 0)&&ae>0&&(l=ae),u 123 are reserved for internal usage");if(Q.name===".notdef")continue;let Ce=Q.getMetrics();t.push(Ce.xMin),n.push(Ce.yMin),s.push(Ce.xMax),r.push(Ce.yMax),a.push(Ce.leftSideBearing),i.push(Ce.rightSideBearing),o.push(Q.advanceWidth)}let m={xMin:Math.min.apply(null,t),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,s),yMax:Math.max.apply(null,r),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:Oi(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,i)};m.ascender=e.ascender,m.descender=e.descender;let d=0;e.weightClass>=600&&(d|=e.macStyleValues.BOLD),e.italicAngle<0&&(d|=e.macStyleValues.ITALIC);let y=zt.make({flags:3,unitsPerEm:e.unitsPerEm,xMin:m.xMin,yMin:m.yMin,xMax:m.xMax,yMax:m.yMax,lowestRecPPEM:3,macStyle:d,createdTimestamp:e.createdTimestamp}),T=jt.make({ascender:m.ascender,descender:m.descender,advanceWidthMax:m.advanceWidthMax,minLeftSideBearing:m.minLeftSideBearing,minRightSideBearing:m.minRightSideBearing,xMaxExtent:m.maxLeftSideBearing+(m.xMax-m.xMin),numberOfHMetrics:e.glyphs.length}),O=$t.make(e.glyphs.length),I=lt.make(Object.assign({xAvgCharWidth:Math.round(m.advanceWidthAvg),usFirstCharIndex:l,usLastCharIndex:u,ulUnicodeRange1:c,ulUnicodeRange2:p,ulUnicodeRange3:f,ulUnicodeRange4:h,sTypoAscender:m.ascender,sTypoDescender:m.descender,sTypoLineGap:0,usWinAscent:m.yMax,usWinDescent:Math.abs(m.yMin),ulCodePageRange1:1,sxHeight:$s(e,"xyvw",{yMax:Math.round(m.ascender/2)}).yMax,sCapHeight:$s(e,"HIKLEFJMNTZBDPRAGOQSUVWXY",m).yMax,usDefaultChar:e.hasChar(" ")?32:0,usBreakChar:e.hasChar(" ")?32:0},e.tables.os2)),E=Wt.make(e.glyphs),D=Nt.make(e.glyphs),P=e.getEnglishName("fontFamily"),M=e.getEnglishName("fontSubfamily"),_=P+" "+M,ce=e.getEnglishName("postScriptName");ce||(ce=P.replace(/\s/g,"")+"-"+M);let L={};for(let N in e.names)L[N]=e.names[N];L.unicode=L.unicode||{},L.macintosh=L.macintosh||{},L.windows=L.windows||{};let ee=e.names.unicode||{},X=e.names.macintosh||{},U=e.names.windows||{};for(let N in L){if(L[N]=L[N]||{},!L[N].uniqueID){let Q=e.getEnglishName("manufacturer")||"";L[N].uniqueID={en:`${Q}: ${_}`}}L[N].postScriptName||(L[N].postScriptName={en:ce})}L.unicode.preferredFamily||(L.unicode.preferredFamily=ee.fontFamily||X.fontFamily||U.fontFamily),L.macintosh.preferredFamily||(L.macintosh.preferredFamily=X.fontFamily||ee.fontFamily||U.fontFamily),L.windows.preferredFamily||(L.windows.preferredFamily=U.fontFamily||ee.fontFamily||X.fontFamily),L.unicode.preferredSubfamily||(L.unicode.preferredSubfamily=ee.fontSubfamily||X.fontSubfamily||U.fontSubfamily),L.macintosh.preferredSubfamily||(L.macintosh.preferredSubfamily=X.fontSubfamily||ee.fontSubfamily||U.fontSubfamily),L.windows.preferredSubfamily||(L.windows.preferredSubfamily=U.fontSubfamily||ee.fontSubfamily||X.fontSubfamily);let k=[],C=Mt.make(L,k),j=k.length>0?qt.make(k):void 0,Ie=Xt.make(e),bt=it.make(e.glyphs,{version:e.getEnglishName("version"),fullName:_,familyName:P,weightName:M,postScriptName:ce,unitsPerEm:e.unitsPerEm,fontBBox:[0,m.yMin,m.ascender,m.advanceWidthMax],topDict:e.tables.cff&&e.tables.cff.topDict||{}}),Be=e.metas&&Object.keys(e.metas).length>0?Zt.make(e.metas):void 0,ue=[y,T,O,I,C,D,Ie,bt,E];j&&ue.push(j);let Y={gsub:Yt,cpal:Ht,colr:Kt,stat:Jt,avar:en,cvar:tn,fvar:Qt,gvar:nn,gasp:sn,svg:rn},oe={avar:[e.tables.fvar],fvar:[e.names]};for(let N in Y){let Q=e.tables[N];if(Q){let ae=Y[N].make.call(e,Q,...oe[N]||[]);ae&&ue.push(ae)}}Be&&ue.push(Be);let W=Xs(ue),te=W.encode(),Z=Bn(te),K=W.fields,H=!1;for(let N=0;N>>1,o=e[r].tag;if(o===t)return r;o>>1,o=e[r];if(o===t)return r;o>>1;n=e[o];let a=n.start;if(a===t)return n;a0)return n=e[s-1],t>n.end?0:n}function Qs(e,t){this.font=e,this.tableName=t}Qs.prototype={searchTag:Gn,binSearch:Zs,getTable:function(e){let t=this.font.tables[this.tableName];return!t&&e&&(t=this.font.tables[this.tableName]=this.createDefaultTable()),t},getScriptNames:function(){let e=this.getTable();return e?e.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){let e=this.getTable();if(!e)return;let t=!1;for(let n=0;n=0)return s[r].script;if(t){let o={tag:e,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return s.splice(-1-r,0,o),o.script}}},getLangSysTable:function(e,t,n){let s=this.getScriptTable(e,n);if(s){if(!t||t==="dflt"||t==="DFLT")return s.defaultLangSys;let r=Gn(s.langSysRecords,t);if(r>=0)return s.langSysRecords[r].langSys;if(n){let o={tag:t,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return s.langSysRecords.splice(-1-r,0,o),o.langSys}}},getFeatureTable:function(e,t,n,s){let r=this.getLangSysTable(e,t,s);if(r){let o,a=r.featureIndexes,i=this.font.tables[this.tableName].features;for(let l=0;l=i[l-1].tag,"Features must be added in alphabetical order."),o={tag:n,feature:{params:0,lookupListIndexes:[]}},i.push(o),a.push(l),o.feature}}},getLookupTables:function(e,t,n,s,r){let o=this.getFeatureTable(e,t,n,r),a=[];if(o){let i,l=o.lookupListIndexes,u=this.font.tables[this.tableName].lookups;for(let c=0;c=0?n:-1}case 2:{let n=Ks(e.ranges,t);return n?n.index+t-n.start:-1}}},expandCoverage:function(e){if(e.format===1)return e.glyphs;{let t=[],n=e.ranges;for(let s=0;sn)r=a-1;else{o=i;break}}return o}function nr(e,t,n){let s=0,r=e.length-1;for(;s<=r;){let o=Math.floor((s+r)/2),a=e[o];if(a[t]n)r=o-1;else return o}return-1}function sr(e,t,n){let s=0,r=e.length,o=(a,i)=>a[t]-i[t];for(;s>>1;o(e[a],n)<0?s=a+1:r=a}return e.splice(s,0,n),s}function Hn(e){return e[0]===31&&e[1]===139&&e[2]===8}function rr(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength),n=10,s=e.byteLength-8,r=t.getInt8(3);if(r&4&&(n+=2+t.getUint16(n,!0)),r&8)for(;n=s)throw new Error("Can't find compressed blocks");let o=t.getUint32(t.byteLength-4,!0);return Tt(e.subarray(n,s),new Uint8Array(o))}function Vn(e){return{x:e.x,y:e.y,onCurve:e.onCurve,lastPointOfContour:e.lastPointOfContour}}function or(e){return{glyphIndex:e.glyphIndex,xScale:e.xScale,scale01:e.scale01,scale10:e.scale10,yScale:e.yScale,dx:e.dx,dy:e.dy}}function se(e){Ye.call(this,e,"gsub")}function _n(e,t,n){let s=e.subtables;for(let r=0;r1,'Multiple: "by" must be an array of two or more ids');let r=this.getLookupTables(n,s,e,2,!0)[0],o=_n(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});v.assert(o.coverage.format===1,"Multiple: unable to modify coverage table format "+o.coverage.format);let a=t.sub,i=this.binSearch(o.coverage.glyphs,a);i<0&&(i=-1-i,o.coverage.glyphs.splice(i,0,a),o.sequences.splice(i,0,0)),o.sequences[i]=t.by};se.prototype.addAlternate=function(e,t,n,s){let r=this.getLookupTables(n,s,e,3,!0)[0],o=_n(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});v.assert(o.coverage.format===1,"Alternate: unable to modify coverage table format "+o.coverage.format);let a=t.sub,i=this.binSearch(o.coverage.glyphs,a);i<0&&(i=-1-i,o.coverage.glyphs.splice(i,0,a),o.alternateSets.splice(i,0,0)),o.alternateSets[i]=t.by};se.prototype.addLigature=function(e,t,n,s){let r=this.getLookupTables(n,s,e,4,!0)[0],o=r.subtables[0];o||(o={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=o),v.assert(o.coverage.format===1,"Ligature: unable to modify coverage table format "+o.coverage.format);let a=t.sub[0],i=t.sub.slice(1),l={ligGlyph:t.by,components:i},u=this.binSearch(o.coverage.glyphs,a);if(u>=0){let c=o.ligatureSets[u];for(let p=0;pot(n,"raw")):ot(t,"raw")}fillPalette(t,n=[],s=this.cpal().numPaletteEntries){return t=Number.isInteger(t)?this.get(t,"raw"):t,Object.assign(Array(s).fill(this.defaultValue),this.toCPALcolor(t).concat(this.toCPALcolor(n)))}extend(t){if(this.ensureCPAL(Array(t).fill(this.defaultValue)))return;let n=this.cpal(),s=n.numPaletteEntries+t,r=this.getAll().map(o=>this.fillPalette(o,[],s));n.numPaletteEntries=s,n.colorRecords=this.toCPALcolor(r.flat()),this.updateIndices()}get(t,n="hexa"){return this.getAll(n)[t]||null}getColor(t,n=0,s="hexa"){return rt(this.font,t,n,s)}setColor(t,n,s=0){t=parseInt(t),s=parseInt(s);let r=this.getAll("raw"),o=r[s];if(!o)throw Error(`paletteIndex ${s} out of range`);let a=this.cpal(),i=a.numPaletteEntries;Array.isArray(n)||(n=[n]),n.length+t>i&&(this.extend(n.length+t-i),r=this.getAll("raw"),o=r[s]);for(let l=0;ls?this.extend(t.length-s):t.lengths.numPaletteEntries-1)throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${s.numPaletteEntries-1}, replacementIndex: ${n})`);for(let l=0;lf!==t);o.push(c)}let a=this.font.tables.colr;if(a){let l=a.layerRecords;for(let u=0;ut)l[u].paletteIndex-=1;else if(c===t){let p=0;for(let f=0;ft&&n<=t+r[f].length){p++;break}l[u].paletteIndex=n-p}}this.font.tables.colr={...a,layerRecords:l}}let i=o.flat();for(let l=0;lr.length?s=r.length:s<0&&(s=r.length+1+s%(r.length+1),s>=r.length+1&&(s-=r.length+1));let o=[];for(let a=0;a({glyphID:o.glyph.index,paletteIndex:a===n?s:o.paletteIndex})),this.updateColrTable(t,r)):console.error("Invalid layer index")}remove(t,n,s=n){let r=this.get(t);r=r.map(o=>({glyphID:o.glyph.index,paletteIndex:o.paletteIndex})),r.splice(n,s-n+1),this.updateColrTable(t,r)}updateColrTable(t,n){this.ensureCOLR();let r=this.font.tables.colr,o=nr(r.baseGlyphRecords,"glyphID",t);if(o===-1){let p={glyphID:t,firstLayerIndex:r.layerRecords.length,numLayers:0};o=sr(r.baseGlyphRecords,"glyphID",p)}let i=r.baseGlyphRecords[o],l=i.numLayers,u=n.length,c=u-l;if(c>0){let p=n.slice(l).map(f=>({glyphID:f.glyphID,paletteIndex:f.paletteIndex}));r.layerRecords.splice(i.firstLayerIndex+l,0,...p)}else c<0&&r.layerRecords.splice(i.firstLayerIndex+u,-c);for(let p=0;p{if(o.image=a,typeof this.font.onGlyphUpdated=="function")try{this.font.onGlyphUpdated(t)}catch(i){console.error("font.onGlyphUpdated",t,i)}}),r.images.set(t,o)),o}};function Fi(e){return{template:Ii(e).then(Li),images:new Map}}function Ui(e,t,n){return{promise:t.then(s=>{let r;typeof s=="string"?r=s:(s[4]=n,r=s.join(""));let o=wi(r,e.unitsPerEm);return o.image.decode().then(()=>o)}),image:void 0}}var Ii=typeof DecompressionStream=="function"?Ei:Ri;function Ri(e){try{return Promise.resolve(new TextDecoder().decode(Hn(e)?rr(e):e))}catch(t){return Promise.reject(t)}}function Ei(e){if(Hn(e))return new Response(new Response(e).body.pipeThrough(new DecompressionStream("gzip"))).text();try{return Promise.resolve(new TextDecoder().decode(e))}catch(t){return Promise.reject(t)}}function Li(e){let t=e.indexOf("");return[e.substring(0,n),"",e.substring(n,s),'',e.substring(s)]}function wi(e,t){let s=new DOMParser().parseFromString(e,"image/svg+xml").documentElement,r=s.viewBox.baseVal,o=s.width.baseVal,a=s.height.baseVal,i=1,l=1;r.width>0&&r.height>0&&(o.unitType===1?(i=o.valueInSpecifiedUnits/r.width,l=a.unitType===1?a.valueInSpecifiedUnits/r.height:i):a.unitType===1?(l=a.valueInSpecifiedUnits/r.height,i=l):t&&(i=t/r.width,l=t/r.height));let u=document.createElement("div");u.style.position="fixed",u.style.visibility="hidden",u.appendChild(s),document.body.appendChild(u);let c=s.getBBox();document.body.removeChild(u);let p=(c.x-r.x)*i,f=(r.y-c.y)*l,h=c.width*i,m=c.height*l;s.setAttribute("viewBox",[c.x,c.y,c.width,c.height].join(" ")),i!==1&&s.setAttribute("width",h),l!==1&&s.setAttribute("height",m);let d=new Image(h,m);return d.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent(s.outerHTML),{leftSideBearing:p,baseline:f,image:d}}var zn=new WeakMap;function ir(e,t,n,s,r){let o;return(t&s)>0?(o=e.parseByte(),t&r||(o=-o),o=n+o):(t&r)>0?o=n:o=n+e.parseShort(),o}function lr(e,t,n){let s=new b.Parser(t,n);e._numberOfContours=s.parseShort(),e._xMin=s.parseShort(),e._yMin=s.parseShort(),e._xMax=s.parseShort(),e._yMax=s.parseShort();let r,o;if(e._numberOfContours>0){let a=e.endPointIndices=[];for(let l=0;l0){let u=s.parseByte();for(let c=0;c0){let l=[],u;if(i>0){for(let f=0;f=0,l.push(u);let c=0;for(let f=0;f0?(r&2)>0?(i.dx=s.parseShort(),i.dy=s.parseShort()):i.matchedPoints=[s.parseUShort(),s.parseUShort()]:(r&2)>0?(i.dx=s.parseChar(),i.dy=s.parseChar()):i.matchedPoints=[s.parseByte(),s.parseByte()],(r&8)>0?i.xScale=i.yScale=s.parseF2Dot14():(r&64)>0?(i.xScale=s.parseF2Dot14(),i.yScale=s.parseF2Dot14()):(r&128)>0&&(i.xScale=s.parseF2Dot14(),i.scale01=s.parseF2Dot14(),i.scale10=s.parseF2Dot14(),i.yScale=s.parseF2Dot14()),e.components.push(i),a=!!(r&32)}if(r&256){e.instructionLength=s.parseUShort(),e.instructions=[];for(let i=0;it.points.length-1||r.matchedPoints[1]>o.points.length-1)throw Error("Matched points out of range in "+t.name);let i=t.points[r.matchedPoints[0]],l=o.points[r.matchedPoints[1]],u={xScale:r.xScale,scale01:r.scale01,scale10:r.scale10,yScale:r.yScale,dx:0,dy:0};l=pt([l],u)[0],u.dx=i.x-l.x,u.dy=i.y-l.y,a=pt(o.points,u)}t.points=t.points.concat(a)}}}finally{n.delete(t.index)}}return ln(t.points)}function Ai(e,t,n,s){let r=new ne.GlyphSet(s);for(let o=0;o=1&&n[s]a)continue;let l=r,u=r;for(r++;r<=a;)s[r]&&(this.deltaInterpolate(u+1,r-1,u,r,n,t),u=r),r++;u===l?this.deltaShift(o,a,u,n,t):(this.deltaInterpolate(u+1,a,u,l,n,t),l>0&&this.deltaInterpolate(o,l-1,u,l,n,t)),r=a+1}}deltaInterpolate(t,n,s,r,o,a){if(t>n)return;let i=["x","y"];for(let u=0;uo[r][c]){var l=s;s=r,r=l}let p=o[s][c],f=o[r][c],h=a[s][c],m=a[r][c];if(p!==f||h===m){let d=p===f?0:(m-h)/(f-p);for(let y=t;y<=n;y++){let T=o[y][c];T<=p?T+=h-p:T>=f?T+=m-f:T=h+(T-p)*d,a[y][c]=T}}}}deltaShift(t,n,s,r,o){let a=o[s].x-r[s].x,i=o[s].y-r[s].y;if(!(a===0&&i===0))for(let l=t;l<=n;l++)l!==s&&(o[l].x+=a,o[l].y+=i)}transformComponents(t,n,s,r,o,a){let i=0;for(let l=0;l-1&&(p.dx+=Math.round(o.deltas[f]*a),p.dy+=Math.round(o.deltasY[f]*a));let h=pt(this.getTransform(c,s).points,p);n.splice(i,h.length,...h),i+=c.points.length}}applyTupleVariationStore(t,n,s,r="gvar",o={}){s||(s=this.font.variation.get());let a=this.getNormalizedCoords(s),{headers:i,sharedPoints:l}=t,u=this.fvar().axes.length,c;r==="gvar"?c=n.map(Vn):r==="cvar"&&(c=[...n]);for(let p=0;pf.intermediateEndTuple[d]){h=0;break}else a[d]Math.max(0,y[d])){h=0;break}h=(h*a[d]+Number.EPSILON)/(y[d]+Number.EPSILON)}}}if(h===0)continue;let m=f.privatePoints.length?f.privatePoints:l;if(r==="gvar"&&o.glyph&&o.glyph.isComposite)this.transformComponents(o.glyph,c,s,m,f,h);else if(m.length===0)for(let d=0;d=l&&(u=l-1),{outerIndex:o,innerIndex:a}=i[s].map[u]}else o=0,a=t;return this.getDelta(i.itemVariationStore,o,a,r)}getDelta(t,n,s,r){if(n>=t.itemVariationSubtables.length)return 0;let o=t.itemVariationSubtables[n];if(s>=o.deltaSets.length)return 0;let a=o.deltaSets[s],i=this.getBlendVector(t,n,r),l=0;for(let u=0;uf.peakCoord||f.peakCoord>f.endCoord||f.startCoord<0&&f.endCoord>0&&f.peakCoord!==0||f.peakCoord===0?h=1:o[p]f.endCoord?h=0:o[p]===f.peakCoord?h=1:o[p]-1?this.set(t):this.set(this.getDefaultCoordinates())}getDefaultCoordinates(){return this.fvar().axes.reduce((t,n)=>(t[n.tag]=n.defaultValue,t),{})}getDefaultInstanceIndex(){let t=this.getDefaultCoordinates(),n=this.getInstanceIndex(t);return n<0&&(n=this.fvar().instances.findIndex(s=>s.name&&s.name.en==="Regular")),n}getInstanceIndex(t){return this.fvar().instances.findIndex(n=>Object.keys(t).every(s=>n.coordinates[s]===t[s]))}getInstance(t){return this.fvar().instances&&this.fvar().instances[t]}set(t){let n;if(Number.isInteger(t)){let s=this.getInstance(t);if(!s)throw Error(`Invalid instance index ${t}`);n={...s.coordinates}}else n=t,this.process.normalizeCoordTags(n);n=Object.assign({},this.font.defaultRenderOptions.variation,n),this.font.defaultRenderOptions=Object.assign({},this.font.defaultRenderOptions,{variation:n})}get(){return Object.assign({},this.font.defaultRenderOptions.variation)}avar(){return this.font.tables.avar}cvar(){return this.font.tables.cvar}fvar(){return this.font.tables.fvar}gvar(){return this.font.tables.gvar}hvar(){return this.font.tables.hvar}};var ur=1e6,hn=64,dn=1e4,Fr,_e,Ur,$n;function Ir(e){this.font=e,this.getCommands=function(t){return cn.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Ni(e){return e}function Rr(e){return Math.sign(e)*Math.round(Math.abs(e))}function Bi(e){return Math.sign(e)*Math.round(Math.abs(e*2))/2}function Gi(e){return Math.sign(e)*(Math.round(Math.abs(e)+.5)-.5)}function Hi(e){return Math.sign(e)*Math.ceil(Math.abs(e))}function Vi(e){return Math.sign(e)*Math.floor(Math.abs(e))}var Er=function(e){let t=this.srPeriod,n=this.srPhase,s=this.srThreshold,r=1;return e<0&&(e=-e,r=-1),e+=s-n,e=Math.trunc(e/t)*t,e+=n,e<0?n*r:e*r},Te={x:1,y:0,axis:"x",distance:function(e,t,n,s){return(n?e.xo:e.x)-(s?t.xo:t.x)},interpolate:function(e,t,n,s){let r,o,a,i,l,u,c;if(!s||s===this){if(r=e.xo-t.xo,o=e.xo-n.xo,l=t.x-t.xo,u=n.x-n.xo,a=Math.abs(r),i=Math.abs(o),c=a+i,c===0){e.x=e.xo+(l+u)/2;return}e.x=e.xo+(l*i+u*a)/c;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,c===0){Te.setRelative(e,e,(l+u)/2,s,!0);return}Te.setRelative(e,e,(l*i+u*a)/c,s,!0)},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(e,t,n,s,r){if(!s||s===this){e.x=(r?t.xo:t.x)+n;return}let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.x=i+(e.y-l)/s.normalSlope},slope:0,touch:function(e){e.xTouched=!0},touched:function(e){return e.xTouched},untouch:function(e){e.xTouched=!1}},Fe={x:0,y:1,axis:"y",distance:function(e,t,n,s){return(n?e.yo:e.y)-(s?t.yo:t.y)},interpolate:function(e,t,n,s){let r,o,a,i,l,u,c;if(!s||s===this){if(r=e.yo-t.yo,o=e.yo-n.yo,l=t.y-t.yo,u=n.y-n.yo,a=Math.abs(r),i=Math.abs(o),c=a+i,c===0){e.y=e.yo+(l+u)/2;return}e.y=e.yo+(l*i+u*a)/c;return}if(r=s.distance(e,t,!0,!0),o=s.distance(e,n,!0,!0),l=s.distance(t,t,!1,!0),u=s.distance(n,n,!1,!0),a=Math.abs(r),i=Math.abs(o),c=a+i,c===0){Fe.setRelative(e,e,(l+u)/2,s,!0);return}Fe.setRelative(e,e,(l*i+u*a)/c,s,!0)},normalSlope:0,setRelative:function(e,t,n,s,r){if(!s||s===this){e.y=(r?t.yo:t.y)+n;return}let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y;e.y=l+s.normalSlope*(e.x-i)},slope:Number.POSITIVE_INFINITY,touch:function(e){e.yTouched=!0},touched:function(e){return e.yTouched},untouch:function(e){e.yTouched=!1}};Object.freeze(Te);Object.freeze(Fe);function dt(e,t){this.x=e,this.y=t,this.axis=void 0,this.slope=t/e,this.normalSlope=-e/t,Object.freeze(this)}dt.prototype.distance=function(e,t,n,s){return this.x*Te.distance(e,t,n,s)+this.y*Fe.distance(e,t,n,s)};dt.prototype.interpolate=function(e,t,n,s){let r,o,a,i,l,u,c;if(a=s.distance(e,t,!0,!0),i=s.distance(e,n,!0,!0),r=s.distance(t,t,!1,!0),o=s.distance(n,n,!1,!0),l=Math.abs(a),u=Math.abs(i),c=l+u,c===0){this.setRelative(e,e,(r+o)/2,s,!0);return}this.setRelative(e,e,(r*u+o*l)/c,s,!0)};dt.prototype.setRelative=function(e,t,n,s,r){s=s||this;let o=r?t.xo:t.x,a=r?t.yo:t.y,i=o+n*s.x,l=a+n*s.y,u=s.normalSlope,c=this.slope,p=e.x,f=e.y;e.x=(c*p-u*i+l-f)/(c-u),e.y=c*(e.x-p)+f};dt.prototype.touch=function(e){e.xTouched=!0,e.yTouched=!0};function mt(e,t){let n=Math.sqrt(e*e+t*t);return e/=n,t/=n,e===1&&t===0?Te:e===0&&t===1?Fe:new dt(e,t)}function Ue(e,t,n,s){this.x=this.xo=Math.round(e*64)/64,this.y=this.yo=Math.round(t*64)/64,this.lastPointOfContour=n,this.onCurve=s,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}Ue.prototype.nextTouched=function(e){let t=this.nextPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.nextPointOnContour;return t};Ue.prototype.prevTouched=function(e){let t=this.prevPointOnContour;for(;!e.touched(t)&&t!==this;)t=t.prevPointOnContour;return t};var ht=Object.freeze(new Ue(0,0)),_i={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};function Me(e,t){switch(this.env=e,this.stack=[],this.prog=t,e){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=Te,this.round=Rr}}Ir.prototype.exec=function(e,t){if(typeof t!="number")throw new Error("Point size is not a number!");if(this._errorState>2)return;let n=this.font,s=this._prepState;if(!s||s.ppem!==t){let r=this._fpgmState;if(!r){Me.prototype=_i,r=this._fpgmState=new Me("fpgm",n.tables.fpgm),r.funcs=[],r.font=n,r.instructionCount=0,r.callDepth=0;try{_e(r)}catch(a){console.log("Hinting error in FPGM:"+a),this._errorState=3;return}}Me.prototype=r,s=this._prepState=new Me("prep",n.tables.prep),s.ppem=t,s.instructionCount=0,s.callDepth=0;let o=n.variation&&n.variation.process.getCvarTransform()||n.tables.cvt;if(o){let a=s.cvt=new Array(o.length),i=t/n.unitsPerEm;for(let l=0;l1))try{return Ur(e,s)}catch(r){this._errorState<1&&(console.log("Hinting error:"+r),console.log("Note: further hinting errors are silenced")),this._errorState=1;return}};Ur=function(e,t){let n=t.ppem/t.font.unitsPerEm,s=n,r=e.components,o,a,i;if(Me.prototype=t,!r)i=new Me("glyf",e.instructions),i.instructionCount=0,i.callDepth=0,$n(e,i,n,s),a=i.gZone;else{let l=t.font;a=[],o=[];for(let u=0;uur)throw new Error("Hinting instructions exceeded maximum of "+ur);if(s=Fr[t[e.ip]],!s)throw new Error("unknown instruction: 0x"+Number(t[e.ip]).toString(16));s(e)}};function mn(e){let t=e.tZone=new Array(e.gZone.length);for(let n=0;n=176&&o<=183)s+=o-176+1;else if(o>=184&&o<=191)s+=(o-184+1)*2;else if(t&&r===1&&o===27)break;while(r>0);e.ip=s}function fr(e,t){t.fv=t.pv=t.dpv=e}function pr(e,t){t.pv=t.dpv=e}function hr(e,t){t.fv=e}function dr(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.pv=t.dpv=mt(i,l)}function mr(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.fv=mt(i,l)}function zi(e){let t=e.stack,n=t.pop(),s=t.pop();e.pv=e.dpv=mt(s,n)}function ji(e){let t=e.stack,n=t.pop(),s=t.pop();e.fv=mt(s,n)}function Wi(e){let t=e.stack,n=e.pv;t.push(n.x*16384),t.push(n.y*16384)}function qi(e){let t=e.stack,n=e.fv;t.push(n.x*16384),t.push(n.y*16384)}function $i(e){e.fv=e.pv}function Xi(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop(),o=t.pop(),a=t.pop(),i=e.z0,l=e.z1,u=i[n],c=i[s],p=l[r],f=l[o],h=e.z2[a],m=u.x,d=u.y,y=c.x,T=c.y,O=p.x,I=p.y,E=f.x,D=f.y,P=(m-y)*(I-D)-(d-T)*(O-E),M=m*T-d*y,_=O*D-I*E;h.x=(M*(O-E)-_*(m-y))/P,h.y=(M*(I-D)-_*(d-T))/P}function Yi(e){e.rp0=e.stack.pop()}function Zi(e){e.rp1=e.stack.pop()}function Ki(e){e.rp2=e.stack.pop()}function Qi(e){let t=e.stack.pop();switch(e.zp0=t,t){case 0:e.tZone||mn(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function Ji(e){let t=e.stack.pop();switch(e.zp1=t,t){case 0:e.tZone||mn(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function el(e){let t=e.stack.pop();switch(e.zp2=t,t){case 0:e.tZone||mn(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function tl(e){let t=e.stack.pop();switch(e.zp0=e.zp1=e.zp2=t,t){case 0:e.tZone||mn(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function nl(e){e.loop=e.stack.pop(),e.loop>dn&&(e.loop=dn)}function sl(e){e.round=Rr}function rl(e){e.round=Gi}function ol(e){let t=e.stack.pop();e.minDis=t/64}function al(e){Lr(e,!1)}function il(e){let t=e.stack.pop();e.ip+=t-1}function ll(e){let t=e.stack.pop();e.cvCutIn=t/64}function cl(e){let t=e.stack;t.push(t[t.length-1])}function jn(e){e.stack.pop()}function ul(e){e.stack.length=0}function fl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n),t.push(s)}function pl(e){let t=e.stack;t.push(t.length)}function hl(e){let t=e.stack,n=t.pop(),s=t.pop();if(s>dn&&(s=dn),++e.callDepth>hn)throw new Error("Hinting call depth exceeded maximum of "+hn);let r=e.ip,o=e.prog;e.prog=e.funcs[n];for(let a=0;ahn)throw new Error("Hinting call depth exceeded maximum of "+hn);let n=e.ip,s=e.prog;e.prog=e.funcs[t],_e(e),e.ip=n,e.prog=s,e.callDepth--}function ml(e){let t=e.stack,n=t.pop();t.push(t[t.length-n])}function gl(e){let t=e.stack,n=t.pop();t.push(t.splice(t.length-n,1)[0])}function yl(e){if(e.env!=="fpgm")throw new Error("FDEF not allowed here");let t=e.stack,n=e.prog,s=e.ip,r=t.pop(),o=s;for(;n[++s]!==45;);e.ip=s,e.funcs[r]=n.slice(o+1,s)}function gr(e,t){let n=t.stack.pop(),s=t.z0[n],r=t.fv,o=t.pv,a=o.distance(s,ht);e&&(a=t.round(a)),r.setRelative(s,ht,a,o),r.touch(s),t.rp0=t.rp1=n}function yr(e,t){let n=t.z2,s=n.length-2,r,o,a;for(let i=0;in?1:0)}function Dl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s>=n?1:0)}function Al(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n===s?1:0)}function Pl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n!==s?1:0)}function Ml(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?1:0)}function Nl(e){let t=e.stack,n=t.pop();t.push(Math.trunc(n)&1?0:1)}function Bl(e){let t=e.stack.pop(),n;t||Lr(e,!0)}function Gl(e){}function Hl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n&&s?1:0)}function Vl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(n||s?1:0)}function _l(e){let t=e.stack,n=t.pop();t.push(n?0:1)}function Wn(e,t){let n=t.stack,s=n.pop(),r=t.fv,o=t.pv,a=t.ppem,i=t.deltaBase+(e-1)*16,l=t.deltaShift,u=t.z0;for(let c=0;c>4)!==a)continue;let m=(f&15)-8;m>=0&&m++;let d=u[p];r.setRelative(d,d,m*l,o)}}function zl(e){let n=e.stack.pop();e.deltaBase=n}function jl(e){let n=e.stack.pop();e.deltaShift=Math.pow(.5,n)}function Wl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s+n)}function ql(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s-n)}function $l(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*64/n)}function Xl(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(s*n/64)}function Yl(e){let t=e.stack,n=t.pop();t.push(Math.abs(n))}function Zl(e){let t=e.stack,n=t.pop();t.push(-n)}function Kl(e){let t=e.stack,n=t.pop();t.push(Math.floor(n/64)*64)}function Ql(e){let t=e.stack,n=t.pop();t.push(Math.ceil(n/64)*64)}function pn(e,t){let n=t.stack,s=n.pop();n.push(t.round(s/64)*64)}function Jl(e){let t=e.stack,n=t.pop(),s=t.pop();e.cvt[s]=n*e.ppem/e.font.unitsPerEm}function qn(e,t){let n=t.stack,s=n.pop(),r=t.ppem,o=t.deltaBase+(e-1)*16,a=t.deltaShift;for(let i=0;i>4)!==r)continue;let p=(u&15)-8;p>=0&&p++;let f=p*a;t.cvt[l]+=f}}function ec(e){let t=e.stack.pop();e.round=Er;let n;switch(t&192){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function tc(e){let t=e.stack.pop();e.round=Er;let n;switch(t&192){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,t&48){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}t&=15,t===0?e.srThreshold=0:e.srThreshold=(t/8-.5)*n}function nc(e){e.round=Ni}function sc(e){e.round=Hi}function rc(e){e.round=Vi}function oc(e){let t=e.stack.pop()}function Cr(e,t){let n=t.stack,s=n.pop(),r=n.pop(),o=t.z2[s],a=t.z1[r],i,l;e?(i=o.y-a.y,l=a.x-o.x):(i=a.x-o.x,l=a.y-o.y),t.dpv=mt(i,l)}function ac(e){let t=e.stack,n=t.pop(),s=0;n&1&&(s=35),n&32&&(s|=4096),t.push(s)}function ic(e){let t=e.stack,n=t.pop(),s=t.pop(),r=t.pop();t.push(s),t.push(n),t.push(r)}function lc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.max(s,n))}function cc(e){let t=e.stack,n=t.pop(),s=t.pop();t.push(Math.min(s,n))}function uc(e){let t=e.stack.pop()}function fc(e){let t=e.stack.pop(),n=e.stack.pop();switch(t){case 1:e.inhibitGridFit=!!n;return;case 2:e.ignoreCvt=!!n;return;default:throw new Error("invalid INSTCTRL[] selector")}}function Ae(e,t){let n=t.stack,s=t.prog,r=t.ip;for(let o=0;o=0?1:-1,y=Math.abs(y),e&&(O=o.cvt[i],s&&Math.abs(y-O)=0&ðis[r[0]].apply(this,r.slice(1).concat(!0))),s=r=>typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"FAIL");if(n.every(s))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:n.filter(s)};this.dispatch("composeRUD",[n.filter(r=>!s(r))])};G.prototype.replaceRange=function(e,t,n,s){t=t!==null?t:this.tokens.length;let r=n.every(o=>o instanceof Ke);if(!isNaN(e)&&this.inboundIndex(e)&&r){let o=this.tokens.splice.apply(this.tokens,[e,t].concat(n));return s||this.dispatch("replaceToken",[e,t,n]),[o,n]}else return{FAIL:"replaceRange: invalid tokens or startIndex."}};G.prototype.replaceToken=function(e,t,n){if(!isNaN(e)&&this.inboundIndex(e)&&t instanceof Ke){let s=this.tokens.splice(e,1,t);return n||this.dispatch("replaceToken",[e,t]),[s[0],t]}else return{FAIL:"replaceToken: invalid token or index."}};G.prototype.removeRange=function(e,t,n){t=isNaN(t)?this.tokens.length:t;let s=this.tokens.splice(e,t);return n||this.dispatch("removeRange",[s,e,t]),s};G.prototype.removeToken=function(e,t){if(!isNaN(e)&&this.inboundIndex(e)){let n=this.tokens.splice(e,1);return t||this.dispatch("removeToken",[n,e]),n}else return{FAIL:"removeToken: invalid token index."}};G.prototype.insertToken=function(e,t,n){return e.every(r=>r instanceof Ke)?(this.tokens.splice.apply(this.tokens,[t,0].concat(e)),n||this.dispatch("insertToken",[e,t]),e):{FAIL:"insertToken: invalid token(s)."}};G.prototype.registerModifier=function(e,t,n){this.events.newToken.subscribe(function(s,r){let o=[s,r],a=t===null||t.apply(this,o)===!0,i=[s,r];if(a){let l=n.apply(this,i);s.setState(e,l)}}),this.registeredModifiers.push(e)};gn.prototype.subscribe=function(e){return typeof e=="function"?this.subscribers.push(e)-1:{FAIL:`invalid '${this.eventId}' event handler`}};gn.prototype.unsubscribe=function(e){this.subscribers.splice(e,1)};B.prototype.setCurrentIndex=function(e){this.index=e,this.current=this.context[e],this.backtrack=this.context.slice(0,e),this.lookahead=this.context.slice(e+1)};B.prototype.get=function(e){switch(!0){case e===0:return this.current;case(e<0&&Math.abs(e)<=this.backtrack.length):return this.backtrack.slice(e)[0];case(e>0&&e<=this.lookahead.length):return this.lookahead[e-1];default:return null}};G.prototype.rangeToText=function(e){if(e instanceof Xn)return this.getRangeTokens(e).map(t=>t.char).join("")};G.prototype.getText=function(){return this.tokens.map(e=>e.char).join("")};G.prototype.getContext=function(e){let t=this.registeredContexts[e];return t||null};G.prototype.on=function(e,t){let n=this.events[e];return n?n.subscribe(t):null};G.prototype.dispatch=function(e,t){let n=this.events[e];if(n instanceof gn)for(let s=0;st.char);for(let t=0;t=r.start&&e<=r.end){let o=e-r.start;return r.index+o}}break}default:return-1}return-1}function dc(e,t){return Ne(e,t.coverage)===-1?null:e+t.deltaGlyphId}function mc(e,t){let n=Ne(e,t.coverage);return n===-1?null:t.substitute[n]}function Zn(e,t){let n=[];for(let s=0;s{let{lookupListIndex:p,sequenceIndex:f}=c,{subtables:h}=this.getLookupByIndex(p);for(let m of h)Ne(u[f],m.coverage)!==-1&&(u[f]=m.deltaGlyphId)};for(let u=0;us.features[r]),this.features[e]=t,this.mapTagsToFeatures(t,e),t};re.prototype.getSubstitutionType=function(e,t){let n=e.lookupType.toString(),s=t.substFormat.toString();return n+s};re.prototype.getLookupMethod=function(e,t){let n=this.getSubstitutionType(e,t);switch(n){case"11":return s=>dc.apply(this,[s,t]);case"12":return s=>mc.apply(this,[s,t]);case"63":return s=>gc.apply(this,[s,t]);case"41":return s=>yc.apply(this,[s,t]);case"21":return s=>vc.apply(this,[s,t]);case"51":return s=>xc.apply(this,[s,t]);case"53":return s=>bc.apply(this,[s,t]);default:throw new Error(`substitutionType : ${n} lookupType: ${e.lookupType} - substFormat: ${t.substFormat} is not yet supported`)}};re.prototype.lookupFeature=function(e){let t=e.contextParams,n=t.index,s=this.getFeature({tag:e.tag,script:e.script});if(!s)return new Error(`font '${(this.font.names.unicode||this.font.names.windows||this.font.names.macintosh).fullName.en}' doesn't support feature '${e.tag}' for script '${e.script}'.`);let r=this.getFeatureLookups(s),o=[].concat(t.context);for(let a=0;as.tag===e.tag);return t&&n};re.prototype.getLookupSubtables=function(e){return e.subtables||null};re.prototype.getLookupByIndex=function(e){return this.font.tables.gsub.lookups[e]||null};re.prototype.getFeatureLookups=function(e){return e.lookupListIndexes.map(this.getLookupByIndex.bind(this))};re.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};Object.prototype.hasOwnProperty.call(this.features,t.script)||this.getScriptFeatures(t.script);let n=this.features[t.script];return n?n.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:`No feature for script ${t.script}`}};var Pr=re;function Sc(e){let t=e.current,n=e.get(-1);return n===null&&ke(t)||!ke(n)&&ke(t)}function Tc(e){let t=e.get(1);return t===null||!ke(t)}var Mr={startCheck:Sc,endCheck:Tc};function kc(e){let t=e.current,n=e.get(-1);return(ke(t)||ge(t))&&!ke(n)}function Oc(e){let t=e.get(1);switch(!0){case t===null:return!0;case(!ke(t)&&!ge(t)):{let n=Ar(t);if(!n)return!0;if(n){let s=!1;if(s=e.lookahead.some(r=>ke(r)||ge(r)),!s)return!0}break}default:return!1}}var Nr={startCheck:kc,endCheck:Oc};function Cc(e,t,n){t[n].setState(e.tag,e.substitution)}function Fc(e,t,n){t[n].setState(e.tag,e.substitution)}function Kn(e,t,n){for(let s=0;s=0;n--){let s=t[n],r=Yn(s),o=ge(s);if(!r&&!o)return!0;if(r)return!1}return!1}function Ec(e){if(Yn(e.current))return!1;for(let t=0;ta.getState("glyphIndex")),0),o=new B(s.map(a=>a.char),0);for(let a=0;as.activeState.value);return new B(n,t||0)}function wc(e){let t="arab",n=this.tokenizer.getRangeTokens(e),s=Hr(n);for(let r=0;r1}function Ac(e){return e.index===e.context.length-1}var _r={startCheck:Dc,endCheck:Ac};function zr(e,t){let n=e.map(s=>s.activeState.value);return new B(n,t||0)}function Pc(e){let t="delf",n="ccmp",s=this.tokenizer.getRangeTokens(e),r=zr(s);for(let o=0;os.activeState.value);return new B(n,t||0)}function Bc(e){let t="latn",n=this.tokenizer.getRangeTokens(e),s=qr(n);for(let r=0;rs.activeState.value);return new B(n,t||0)}function Vc(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=Yr(n,0);for(let r=0;rs.activeState.value);return new B(n,t||0)}function _c(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=Kr(n,0);for(let r=0;rs.activeState.value);return new B(n,t||0)}function zc(e){let t="thai",n=this.tokenizer.getRangeTokens(e),s=Jr(n,0);for(let r=0;r=6155&&t<=6157||t>=65024&&t<=65039||t>=917760&&t<=917999}function jc(e){let t=e.current,n=e.get(1);return n===null&&Qn(t)||Qn(n)}function Wc(e){let t=e.get(1);return t===null||!Qn(t)}var to={startCheck:jc,endCheck:Wc};function qc(e){let t=this.query.font,n=this.tokenizer.getRangeTokens(e);if(n[1].setState("deleted",!0),t.tables.cmap&&t.tables.cmap.varSelectorList){let s=n[0].char.codePointAt(0),r=n[1].char.codePointAt(0),o=t.tables.cmap.varSelectorList[r];if(o!==void 0&&o.nonDefaultUVS){let a=o.nonDefaultUVS.uvsMappings;if(a[s]){let i=a[s].glyphID;t.glyphs.glyphs[i]!==void 0&&n[0].setState("glyphIndex",i)}}}}var no=qc;function le(e){this.baseDir=e||"ltr",this.tokenizer=new Dr,this.featuresTags={}}le.prototype.setText=function(e){this.text=e};le.prototype.contextChecks={ccmpReplacementCheck:_r,latinWordCheck:Wr,arabicWordCheck:Mr,arabicSentenceCheck:Nr,thaiWordCheck:Xr,unicodeVariationSequenceCheck:to};function Qe(e){let t=this.contextChecks[`${e}Check`];return this.tokenizer.registerContextChecker(e,t.startCheck,t.endCheck)}function $c(){return Qe.call(this,"ccmpReplacement"),Qe.call(this,"latinWord"),Qe.call(this,"arabicWord"),Qe.call(this,"arabicSentence"),Qe.call(this,"thaiWord"),Qe.call(this,"unicodeVariationSequence"),this.tokenizer.tokenize(this.text)}function Xc(){let e=this.tokenizer.getContextRanges("arabicSentence");for(let t=0;tthis.query.supports({script:e,tag:s}));Object.prototype.hasOwnProperty.call(this.featuresTags,e)?this.featuresTags[e]=this.featuresTags[e].concat(n):this.featuresTags[e]=n};le.prototype.applyFeatures=function(e,t){if(!e)throw new Error("No valid font was provided to apply features");this.query||(this.query=new Pr(e));for(let n=0;n0)throw new Error("When creating a new Font object, negative descender value is required.");this.names={},this.names.unicode=Jn(e),this.names.macintosh=Jn(e),this.names.windows=Jn(e),this.unitsPerEm=e.unitsPerEm||1e3,this.ascender=e.ascender,this.descender=e.descender,this.createdTimestamp=e.createdTimestamp,this.italicAngle=e.italicAngle||0,this.weightClass=e.weightClass||0;let t=0;e.fsSelection?t=e.fsSelection:(this.italicAngle<0?t|=this.fsSelectionValues.ITALIC:this.italicAngle>0&&(t|=this.fsSelectionValues.OBLIQUE),this.weightClass>=600&&(t|=this.fsSelectionValues.BOLD),t===0&&(t=this.fsSelectionValues.REGULAR)),(!e.panose||!Array.isArray(e.panose))&&(e.panose=[0,0,0,0,0,0,0,0,0]),this.tables=Object.assign(e.tables,{os2:Object.assign({usWeightClass:e.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:e.widthClass||this.usWidthClasses.MEDIUM,bFamilyType:e.panose[0]||0,bSerifStyle:e.panose[1]||0,bWeight:e.panose[2]||0,bProportion:e.panose[3]||0,bContrast:e.panose[4]||0,bStrokeVariation:e.panose[5]||0,bArmStyle:e.panose[6]||0,bLetterform:e.panose[7]||0,bMidline:e.panose[8]||0,bXHeight:e.panose[9]||0,fsSelection:t},e.tables.os2)})}this.supported=!0,this.glyphs=new ne.GlyphSet(this,e.glyphs||[]),this.encoding=new In(this),this.position=new Js(this),this.substitution=new ar(this),this.tables=this.tables||{},this.tables=new Proxy(this.tables,{set:(t,n,s)=>(t[n]=s,t.fvar&&(t.gvar||t.cff2)&&!this.variation&&(this.variation=new fn(this)),!0)}),this.palettes=new Ze(this),this.layers=new on(this),this.svgImages=new an(this),this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:this.outlinesFormat==="truetype"?this._hinting=new wr(this):null}})}A.prototype.hasChar=function(e){return this.encoding.charToGlyphIndex(e)>0};A.prototype.charToGlyphIndex=function(e){return this.encoding.charToGlyphIndex(e)};A.prototype.charToGlyph=function(e){let t=this.charToGlyphIndex(e),n=this.glyphs.get(t);return n||(n=this.glyphs.get(0)),n};A.prototype.updateFeatures=function(e){return this.defaultRenderOptions.features.map(t=>t.script==="latn"?{script:"latn",tags:t.tags.filter(n=>e[n])}:t)};A.prototype.stringToGlyphIndexes=function(e,t){let n=new so,s=o=>this.charToGlyphIndex(o.char);n.registerModifier("glyphIndex",null,s);let r=t?this.updateFeatures(t.features):this.defaultRenderOptions.features;return n.applyFeatures(this,r),n.getTextGlyphs(e)};A.prototype.stringToGlyphs=function(e,t){let n=this.stringToGlyphIndexes(e,t),s=n.length,r=new Array(s),o=this.glyphs.get(0);for(let a=0;a{let c=a.getPath(i,l,u,r,this);if(r.drawSVG||r.drawLayers){let p=c._layers;if(p&&p.length){for(let f=0;f0,"No English "+r+" specified.")}if(s("fontFamily"),s("weightName"),s("manufacturer"),s("copyright"),s("version"),n(this.unitsPerEm>0,"No unitsPerEm specified."),this.tables.colr){let r=this.tables.colr.baseGlyphRecords,o=-1;for(let a=0;ar[a].glyphID)break;o=i}}return e};A.prototype.toTables=function(){return Ys.fontToTable(this)};A.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()};A.prototype.toArrayBuffer=function(){let t=this.toTables().encode(),n=new ArrayBuffer(t.length),s=new Uint8Array(n);for(let r=0;r=1.2&&(r.markGlyphSets=n.parsePointer(iu)),r}var ao={parse:lu};var ye=new Array(10);ye[1]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();if(n===1)return{posFormat:1,coverage:this.parsePointer(g.coverage),value:this.parseValueRecord()};if(n===2)return{posFormat:2,coverage:this.parsePointer(g.coverage),values:this.parseValueRecordList()};v.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")};ye[2]=function(){let t=this.offset+this.relativeOffset,n=this.parseUShort();v.assert(n===1||n===2,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");let s=this.parsePointer(g.coverage),r=this.parseUShort(),o=this.parseUShort();if(n===1)return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,pairSets:this.parseList(g.pointer(g.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}})))};if(n===2){let a=this.parsePointer(g.classDef),i=this.parsePointer(g.classDef),l=this.parseUShort(),u=this.parseUShort();return{posFormat:n,coverage:s,valueFormat1:r,valueFormat2:o,classDef1:a,classDef2:i,class1Count:l,class2Count:u,classRecords:this.parseList(l,g.list(u,function(){return{value1:this.parseValueRecord(r),value2:this.parseValueRecord(o)}}))}}};ye[3]=function(){return{error:"GPOS Lookup 3 not supported"}};ye[4]=function(){return{error:"GPOS Lookup 4 not supported"}};ye[5]=function(){return{error:"GPOS Lookup 5 not supported"}};ye[6]=function(){return{error:"GPOS Lookup 6 not supported"}};ye[7]=function(){return{error:"GPOS Lookup 7 not supported"}};ye[8]=function(){return{error:"GPOS Lookup 8 not supported"}};ye[9]=function(){return{error:"GPOS Lookup 9 not supported"}};function cu(e,t){t=t||0;let n=new g(e,t),s=n.parseVersion(1);return v.argument(s===1||s===1.1,"Unsupported GPOS table version "+s),s===1?{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(ye)}:{version:s,scripts:n.parseScriptList(),features:n.parseFeatureList(),lookups:n.parseLookupList(ye),variations:n.parseFeatureVariationsList()}}var uu=new Array(10);function fu(e){return new x.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new x.ScriptList(e.scripts)},{name:"features",type:"TABLE",value:new x.FeatureList(e.features)},{name:"lookups",type:"TABLE",value:new x.LookupList(e.lookups,uu)}])}var io={parse:cu,make:fu};function pu(e){let t={};e.skip("uShort");let n=e.parseUShort();v.argument(n===0,"Unsupported kern sub-table version."),e.skip("uShort",2);let s=e.parseUShort();e.skip("uShort",3);for(let r=0;r1&&console.warn("Only the first kern subtable is supported."),e.skip("uLong");let r=e.parseUShort()&255;if(e.skip("uShort"),r===0){let o=e.parseUShort();e.skip("uShort",3);for(let a=0;a
+
+
+
diff --git a/packages/console/app/public/press/anomaly/anomaly-mark.png b/packages/console/app/public/press/anomaly/anomaly-mark.png
new file mode 100644
index 00000000000..9e681578620
Binary files /dev/null and b/packages/console/app/public/press/anomaly/anomaly-mark.png differ
diff --git a/packages/console/app/public/press/anomaly/anomaly-mark.svg b/packages/console/app/public/press/anomaly/anomaly-mark.svg
new file mode 100644
index 00000000000..b21a6e6eab0
--- /dev/null
+++ b/packages/console/app/public/press/anomaly/anomaly-mark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/console/app/public/press/anomaly/anomaly-wordmark-white.png b/packages/console/app/public/press/anomaly/anomaly-wordmark-white.png
new file mode 100644
index 00000000000..c5e5e821d64
Binary files /dev/null and b/packages/console/app/public/press/anomaly/anomaly-wordmark-white.png differ
diff --git a/packages/console/app/public/press/anomaly/anomaly-wordmark-white.svg b/packages/console/app/public/press/anomaly/anomaly-wordmark-white.svg
new file mode 100644
index 00000000000..a91cae11563
--- /dev/null
+++ b/packages/console/app/public/press/anomaly/anomaly-wordmark-white.svg
@@ -0,0 +1,7 @@
+
diff --git a/packages/console/app/public/press/anomaly/anomaly-wordmark.png b/packages/console/app/public/press/anomaly/anomaly-wordmark.png
new file mode 100644
index 00000000000..26ca9108c40
Binary files /dev/null and b/packages/console/app/public/press/anomaly/anomaly-wordmark.png differ
diff --git a/packages/console/app/public/press/anomaly/anomaly-wordmark.svg b/packages/console/app/public/press/anomaly/anomaly-wordmark.svg
new file mode 100644
index 00000000000..5d240265850
--- /dev/null
+++ b/packages/console/app/public/press/anomaly/anomaly-wordmark.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/packages/console/app/src/i18n/en.ts b/packages/console/app/src/i18n/en.ts
index 76f785f72eb..0881681fa4e 100644
--- a/packages/console/app/src/i18n/en.ts
+++ b/packages/console/app/src/i18n/en.ts
@@ -665,9 +665,6 @@ export const dict = {
"enterprise.form.inferenceSpend.over100k": "$100K or more",
"enterprise.form.error.invalidInferenceSpend": "Select a valid inference spend range.",
"enterprise.form.error.captcha": "Captcha verification failed. Please try again.",
- // Still used by dev's old changelog page until its replacement lands in a later commit.
- "changelog.empty": "No changelog entries found.",
- "changelog.viewJson": "View JSON",
} as const
export type Key = keyof typeof dict
diff --git a/packages/console/app/src/routes/brand/index.css b/packages/console/app/src/routes/brand/index.css
index 7fc2e743e74..372b9cf7004 100644
--- a/packages/console/app/src/routes/brand/index.css
+++ b/packages/console/app/src/routes/brand/index.css
@@ -1,556 +1,1872 @@
-::selection {
- background: var(--color-background-interactive);
- color: var(--color-text-strong);
+[data-page="brand"] {
+ /* Verdict colors for the don'ts. Both pass 4.5:1 on the page and on --bg-weak, light and dark. */
+ --brand-dont: light-dark(hsl(4, 72%, 45%), hsl(4, 90%, 68%));
+ --brand-do: light-dark(hsl(145, 60%, 28%), hsl(145, 50%, 58%));
+ /* The "clay and slate" color fields of the Transparent backgrounds. Solid tiles take them in order,
+ so the sections rhyme. */
+ --brand-light-1: #f3c4a6;
+ --brand-light-2: #c6d2e0;
+ --brand-light-3: #ead7c3;
+ --brand-light-4: #d9e2ea;
+ --brand-light-base: #f7f3ee;
+ --brand-dark-1: #9a3f1e;
+ --brand-dark-2: #334e6e;
+ --brand-dark-3: #5b3a29;
+ --brand-dark-base: #11151a;
+ /* Film grain over the blurred fields: greyscale noise, overlaid. */
+ --brand-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='2.2' numOctaves='1' stitchTiles='stitch'/%3E%3CfeColorMatrix values='1.8 0 0 0 -0.4 1.8 0 0 0 -0.4 1.8 0 0 0 -0.4 0 0 0 0 0.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
- @media (prefers-color-scheme: dark) {
- background: var(--color-background-interactive);
- color: var(--color-text-inverted);
- }
-}
-
-[data-page="enterprise"],
-[data-page="legal"] {
- --color-background: hsl(0, 20%, 99%);
- --color-background-weak: hsl(0, 8%, 97%);
- --color-background-weak-hover: hsl(0, 8%, 94%);
- --color-background-strong: hsl(0, 5%, 12%);
- --color-background-strong-hover: hsl(0, 5%, 18%);
- --color-background-interactive: hsl(62, 84%, 88%);
- --color-background-interactive-weaker: hsl(64, 74%, 95%);
-
- --color-text: hsl(0, 1%, 39%);
- --color-text-weak: hsl(0, 1%, 60%);
- --color-text-weaker: hsl(30, 2%, 81%);
- --color-text-strong: hsl(0, 5%, 12%);
- --color-text-inverted: hsl(0, 20%, 99%);
- --color-text-success: hsl(119, 100%, 35%);
-
- --color-border: hsl(30, 2%, 81%);
- --color-border-weak: hsl(0, 1%, 85%);
-
- --color-icon: hsl(0, 1%, 55%);
- --color-success: hsl(142, 76%, 36%);
-
- background: var(--color-background);
- font-family: var(--font-mono);
- color: var(--color-text);
- padding-bottom: 5rem;
-
- @media (prefers-color-scheme: dark) {
- --color-background: hsl(0, 9%, 7%);
- --color-background-weak: hsl(0, 6%, 10%);
- --color-background-weak-hover: hsl(0, 6%, 15%);
- --color-background-strong: hsl(0, 15%, 94%);
- --color-background-strong-hover: hsl(0, 15%, 97%);
- --color-background-interactive: hsl(62, 100%, 90%);
- --color-background-interactive-weaker: hsl(60, 20%, 8%);
-
- --color-text: hsl(0, 4%, 71%);
- --color-text-weak: hsl(0, 2%, 49%);
- --color-text-weaker: hsl(0, 3%, 28%);
- --color-text-strong: hsl(0, 15%, 94%);
- --color-text-inverted: hsl(0, 9%, 7%);
- --color-text-success: hsl(119, 60%, 72%);
-
- --color-border: hsl(0, 3%, 28%);
- --color-border-weak: hsl(0, 4%, 23%);
-
- --color-icon: hsl(10, 3%, 43%);
- --color-success: hsl(142, 76%, 46%);
- }
-
- /* Header and Footer styles - copied from index.css */
- [data-component="top"] {
- padding: 24px 5rem;
- height: 80px;
- position: sticky;
- top: 0;
+ [data-slot="hero-actions"] {
display: flex;
- justify-content: space-between;
- align-items: center;
- background: var(--color-background);
- border-bottom: 1px solid var(--color-border-weak);
- z-index: 10;
+ flex-wrap: wrap;
+ gap: 0.75rem;
+ }
- @media (max-width: 60rem) {
- padding: 24px 1.5rem;
+ /* Both labels share one cell, so the copy button keeps the width of the longer one. */
+ [data-slot="copy-labels"] {
+ display: inline-grid;
+
+ > span {
+ grid-area: 1 / 1;
+ visibility: hidden;
}
- img {
- height: 34px;
- width: auto;
- }
-
- [data-component="nav-desktop"] {
- ul {
- display: flex;
- justify-content: space-between;
- align-items: center;
- gap: 32px;
-
- @media (max-width: 55rem) {
- gap: 24px;
- }
-
- @media (max-width: 48rem) {
- gap: 24px;
- }
- li {
- display: inline-block;
- a {
- text-decoration: none;
- span {
- color: var(--color-text-weak);
- }
- }
- a:hover {
- text-decoration: underline;
- text-underline-offset: 2px;
- text-decoration-thickness: 1px;
- }
- [data-slot="cta-button"] {
- background: var(--color-background-strong);
- color: var(--color-text-inverted);
- padding: 8px 16px 8px 10px;
- border-radius: 4px;
- font-weight: 500;
- text-decoration: none;
- display: flex;
- align-items: center;
- gap: 8px;
- white-space: nowrap;
-
- @media (max-width: 55rem) {
- display: none;
- }
- }
- [data-slot="cta-button"]:hover {
- background: var(--color-background-strong-hover);
- text-decoration: none;
- }
- }
- }
-
- @media (max-width: 40rem) {
- display: none;
- }
- }
-
- [data-component="nav-mobile"] {
- button > svg {
- color: var(--color-icon);
- }
- }
-
- [data-component="nav-mobile-toggle"] {
- border: none;
- background: none;
- outline: none;
- height: 40px;
- width: 40px;
- cursor: pointer;
- margin-right: -8px;
- }
-
- [data-component="nav-mobile-toggle"]:hover {
- background: var(--color-background-weak);
- }
-
- [data-component="nav-mobile"] {
- display: none;
-
- @media (max-width: 40rem) {
- display: block;
-
- [data-component="nav-mobile-icon"] {
- cursor: pointer;
- height: 40px;
- width: 40px;
- display: flex;
- align-items: center;
- justify-content: center;
- }
-
- [data-component="nav-mobile-menu-list"] {
- position: fixed;
- background: var(--color-background);
- top: 80px;
- left: 0;
- right: 0;
- height: 100vh;
-
- ul {
- list-style: none;
- padding: 20px 0;
-
- li {
- a {
- text-decoration: none;
- padding: 20px;
- display: block;
-
- span {
- color: var(--color-text-weak);
- }
- }
-
- a:hover {
- background: var(--color-background-weak);
- }
- }
- }
- }
- }
- }
-
- [data-slot="logo dark"] {
- display: none;
- }
-
- @media (prefers-color-scheme: dark) {
- [data-slot="logo light"] {
- display: none;
- }
- [data-slot="logo dark"] {
- display: block;
- }
+ > [data-active] {
+ visibility: visible;
}
}
- [data-component="footer"] {
- border-top: 1px solid var(--color-border-weak);
- display: flex;
- flex-direction: row;
+ [data-slot="sr-only"] {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip-path: inset(50%);
+ white-space: nowrap;
+ }
- @media (max-width: 65rem) {
- border-bottom: 1px solid var(--color-border-weak);
+ /* Landscape preview tiles, 2:1 like every other preview on the page. Each tile keeps its own color scheme so light logos stay on light and dark on dark. */
+ [data-component="brand-tiles"] {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 2rem var(--gutter);
+
+ li {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ min-width: 0;
}
- [data-slot="cell"] {
- flex: 1;
- text-align: center;
+ [data-slot="preview"] {
+ aspect-ratio: 2;
+ display: grid;
+ place-items: center;
- a {
- text-decoration: none;
- padding: 2rem 0;
- width: 100%;
+ /* Each tile keeps the background its files are made for, whatever the page's theme: fixed
+ colours, and "only" so a browser's automatic dark mode (Chrome's forced dark, which some device
+ previews turn on) can't darken the light tile or invert its artwork. */
+ &[data-tone="light"] {
+ color-scheme: only light;
+ background: #f5f5f5;
+ }
+
+ &[data-tone="dark"] {
+ color-scheme: only dark;
+ background: #0a0a0a;
+ box-shadow: inset 0 0 0 1px var(--border);
+ }
+
+ img {
display: block;
-
- span {
- color: var(--color-text-weak);
-
- @media (max-width: 40rem) {
- display: none;
- }
- }
+ max-width: 100%;
}
- a:hover {
- background: var(--color-background-weak);
- text-decoration: underline;
- text-underline-offset: 2px;
- text-decoration-thickness: 1px;
+ /* Whole-pixel steps: the logo at 48 × 60px (4:5, 12px stroke), the wordmark at 156 × 28px
+ (39 × 7 strokes of 4px). The square files pad the logo to 60 × 60px. */
+ &[data-kind="logo"] img {
+ width: 48px;
+ height: 60px;
+ }
+
+ &[data-kind="logo"][data-square] img {
+ width: 60px;
+ }
+
+ &[data-kind="wordmark"] img {
+ width: 156px;
+ height: 28px;
}
}
- [data-slot="cell"] + [data-slot="cell"] {
- border-left: 1px solid var(--color-border-weak);
-
- @media (max-width: 40rem) {
- border-left: none;
- }
+ /* The caption above the thumbnail and the buttons under it: the meta row dissolves into the
+ tile's column, and the caption moves first. */
+ [data-slot="meta"] {
+ display: contents;
}
- /* Mobile: third column on its own row */
- @media (max-width: 25rem) {
+ li > [data-slot="meta"] > [data-slot="name"] {
+ order: -1;
+ }
+
+ /* The buttons at the inline end under the tile (the right, or the left in right-to-left text). */
+ li > [data-slot="meta"] > :is([data-slot="actions"], [data-slot="badge-actions"]) {
+ align-self: end;
+ margin-inline-start: 0;
+ }
+
+ /* The file name beside the PNG and SVG buttons: sans, at the row title's size ("Logo"),
+ in grey under the dark title. */
+ [data-slot="name"] {
+ font-family: var(--font-sans);
+ font-size: var(--fs-small);
+ color: var(--text-weak);
+ }
+
+ [data-slot="actions"] {
+ display: flex;
flex-wrap: wrap;
+ gap: 0.5rem;
+ margin-inline-start: auto;
+ }
- [data-slot="cell"] {
- flex: 1 0 100%;
- border-left: none;
- border-top: 1px solid var(--color-border-weak);
+ [data-component="site-button"] {
+ padding: 0 0.75rem;
+ }
+
+ [data-slot="note"] {
+ margin-inline-start: 0.375rem;
+ color: var(--text-weak);
+ }
+
+ /* The app icons at 96px; the avatars cropped to a circle, the way profiles show them. */
+ /* The light avatar on the dark tile and the dark one on the light tile, as a profile picture on
+ a UI of the other scheme. */
+ [data-kind="avatar"] img {
+ width: 96px;
+ height: 96px;
+ }
+
+ [data-kind="avatar"] img {
+ border-radius: 50%;
+ }
+
+ [data-kind="badge"] img {
+ width: 200px;
+ height: 44px;
+ }
+ }
+
+ /* Settings › Brand asset actions. Every style keeps the actions on the right of the asset's name. */
+ [data-slot="actions"] {
+ /* Only the chosen style shows; every style is in the markup (see Actions in index.tsx). */
+ /* Every asset's buttons sit at the inline end of their row (the right, or the left in right-to-left
+ text), in their order; a row that wraps keeps each line at that end too. */
+ > [data-variant] {
+ display: none;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ align-items: center;
+ gap: 0.5rem;
+ }
+
+ &[data-style="menu copy"] > [data-variant="menu copy"],
+ &[data-style="menu"] > [data-variant="menu"],
+ &[data-style="split"] > [data-variant="split"],
+ &[data-style="icons"] > [data-variant="icons"],
+ &[data-style="text links"] > [data-variant="text links"],
+ &[data-style="svg copy"] > [data-variant="svg copy"],
+ &[data-style="hover reveal"] > [data-variant="hover reveal"] {
+ display: flex;
+ }
+
+ /* One "Download" button and a grey menu, as the site's other menus: a tint and a mid-grey bar on
+ hover and keyboard focus. */
+ [data-slot="asset-menu"] {
+ position: relative;
+
+ > [data-component="site-button"] {
+ gap: 0.375rem;
+ }
+ }
+
+ /* As wide as its button and lined up with its left edge; a long label ends in "…". Rows as in
+ the logo menu (site.css), but OpenTUI Mono at 14px rather than its 12px (David found 12px too small);
+ 0.5rem × 0.875rem padding, 14px icons, the popover
+ background and shadow, and the grey menu states (a tint and a mid-grey bar on hover and
+ keyboard focus). */
+ [data-slot="menu"] {
+ position: absolute;
+ top: calc(100% + 0.25rem);
+ inset-inline-start: 0;
+ z-index: 20;
+ display: flex;
+ flex-direction: column;
+ width: max-content;
+ min-width: 100%;
+ background: var(--popover-bg);
+ box-shadow: var(--popover-shadow);
+ font-family: var(--font-mono);
+ font-size: var(--fs-small);
+ color: var(--text-strong);
+ animation: settings-in 140ms var(--ease-out);
+
+ > * {
+ position: relative;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.625rem;
+ min-width: 0;
+ padding: 0.5rem 0.875rem;
+ background: none;
+ font: inherit;
+ color: inherit;
+ text-align: start;
+ text-decoration: none;
+ white-space: nowrap;
+ cursor: pointer;
+
+ svg {
+ flex-shrink: 0;
+ width: 14px;
+ height: 14px;
+ }
+
+ &::before {
+ content: "";
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ inset-inline-start: -1px;
+ width: 2px;
+ background: var(--menu-hint);
+ opacity: 0;
+ }
+
+ &:focus-visible {
+ outline: none;
+ background: var(--menu-hover);
+
+ &::before {
+ opacity: 1;
+ }
+ }
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ outline: none;
+ background: var(--menu-hover);
+
+ &::before {
+ opacity: 1;
+ }
+ }
+ }
+
+ &:active {
+ background: var(--menu-press);
+ }
+ }
+ }
+
+ /* A part of the menu: a small grey title (or, untitled, just a hairline) above its items. */
+ [data-slot="menu"] > [data-slot="menu-group"] {
+ padding: 0.625rem 0.875rem 0.25rem;
+ font-size: var(--fs-meta);
+ color: var(--text-weak);
+ cursor: default;
+
+ &:not(:first-child) {
+ border-top: 1px solid var(--border);
}
- [data-slot="cell"]:nth-child(1) {
- border-top: none;
+ &:empty {
+ padding: 0;
+ }
+
+ &::before {
+ display: none;
+ }
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ background: none;
+ }
+ }
+
+ &:active {
+ background: none;
+ }
+ }
+
+ > [data-variant="menu copy"] {
+ gap: 0.25rem;
+ }
+
+ /* PNG, SVG and the copy square: tight, and kept to the right when they wrap under the caption. */
+ [data-slot="meta"] > & {
+ margin-inline-start: auto;
+ }
+
+ > [data-variant="svg copy"] {
+ gap: 0.25rem;
+
+ > [data-component="site-button"] {
+ padding: 0 0.625rem;
+ }
+ }
+
+ /* Menu + copy: a square copy icon next to Download, as tall as it. */
+ [data-slot="copy-square"] {
+ justify-content: center;
+ width: 2.25rem;
+ padding: 0;
+ }
+
+ [data-slot="item-label"] {
+ min-width: 0;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+
+ /* Split: the main part downloads the PNG; the chevron opens the other formats. */
+ > [data-variant="split"] {
+ gap: 1px;
+ }
+
+ [data-slot="chevron-button"] {
+ padding: 0 0.5rem;
+ }
+
+ /* Like the product cards' split button, the chevron fills blue while its menu is open. */
+ [data-site]:is([data-button-hover="blue"], [data-button-hover="blue-ring"])
+ &
+ > [data-variant="split"]
+ [data-slot="chevron-button"][aria-expanded="true"] {
+ background: var(--link);
+ color: #fff;
+ }
+
+ /* Icons: square buttons, named by their tooltips and labels. */
+ > [data-variant="icons"] [data-component="site-button"] {
+ justify-content: center;
+ width: 2.25rem;
+ padding: 0;
+ }
+
+ /* Text links: no button chrome, underlined on hover. */
+ [data-slot="links"] {
+ font-size: var(--fs-small);
+ color: var(--text-weak);
+
+ :is(a, button) {
+ padding: 0;
+ background: none;
+ font: inherit;
+ color: var(--text);
+ text-decoration: underline;
+ text-decoration-color: transparent;
+ text-underline-offset: 0.2em;
+ cursor: pointer;
+ transition:
+ color 150ms ease,
+ text-decoration-color 150ms ease;
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ color: var(--text-strong);
+ text-decoration-color: currentColor;
+ }
+ }
+
+ &:active {
+ color: var(--text-strong);
+ text-decoration-color: currentColor;
+ }
+
+ &:focus-visible {
+ color: var(--text-strong);
+ }
+ }
+ }
+
+ /* Hover reveal: the buttons wait for the card to be hovered or focused; touch always shows them. */
+ &[data-style="hover reveal"] {
+ opacity: 0;
+ transition: opacity 150ms ease;
+
+ @media (hover: none), (pointer: coarse) {
+ opacity: 1;
}
}
}
- [data-component="container"] {
- max-width: 67.5rem;
- margin: 0 auto;
- border: 1px solid var(--color-border-weak);
- border-top: none;
+ li:focus-within [data-slot="actions"][data-style="hover reveal"] {
+ opacity: 1;
+ }
- @media (max-width: 65rem) {
- border: none;
+ @media (hover: hover) and (pointer: fine) {
+ li:hover [data-slot="actions"][data-style="hover reveal"] {
+ opacity: 1;
}
}
- [data-component="content"] {
+ [data-slot="download-icon"] {
+ flex-shrink: 0;
}
- [data-component="brand-content"] {
- padding: 4rem 5rem;
-
- h1 {
- font-size: 1.5rem;
- font-weight: 700;
- color: var(--color-text-strong);
- margin-bottom: 1rem;
- }
+ [data-component="palette"] {
+ container-type: inline-size;
+ display: flex;
+ flex-direction: column;
+ gap: 1rem;
h3 {
- font-size: 1.25rem;
- font-weight: 500;
- color: var(--color-text-strong);
- margin: 2rem 0 1rem 0;
- }
-
- p {
- line-height: 1.6;
- margin-bottom: 2.5rem;
- color: var(--color-text);
- }
-
- [data-component="download-button"] {
- padding: 8px 12px 8px 20px;
- background: var(--color-background-strong);
- color: var(--color-text-inverted);
- border: none;
- border-radius: 4px;
- font-weight: 500;
- cursor: pointer;
- display: flex;
- width: fit-content;
- align-items: center;
- gap: 12px;
- transition: all 0.2s ease;
- text-decoration: none;
-
- &:hover:not(:disabled) {
- background: var(--color-background-strong-hover);
- }
-
- &:active {
- transform: scale(0.98);
- }
-
- &:disabled {
- opacity: 0.6;
- cursor: not-allowed;
- }
- }
-
- [data-component="brand-grid"] {
- display: grid;
- grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
- gap: 2rem;
- margin-top: 4rem;
- margin-bottom: 2rem;
- }
-
- [data-component="brand-grid"] img {
- width: 100%;
- height: auto;
- display: block;
- border-radius: 4px;
- border: 1px solid var(--color-border-weak);
- }
-
- [data-component="brand-grid"] > div {
- position: relative;
- }
-
- [data-component="actions"] {
- position: absolute;
- background: rgba(4, 0, 0, 0.08);
- border-radius: 4px;
- bottom: 0;
- right: 0;
- top: 0;
- left: 0;
- display: flex;
- justify-content: center;
- align-items: center;
- gap: 16px;
- opacity: 0;
-
- @media (max-width: 40rem) {
- position: static;
- opacity: 1;
- background: none;
- margin-top: 1rem;
- justify-content: start;
- }
- }
-
- [data-component="brand-grid"] > div:hover [data-component="actions"],
- [data-component="brand-grid"] > div:focus-within [data-component="actions"] {
- opacity: 1;
-
- @media (max-width: 40rem) {
- opacity: 1;
- }
- }
-
- [data-component="actions"] button {
- padding: 6px 12px;
- background: var(--color-background);
- color: var(--color-text);
- border: none;
- border-radius: 4px;
- font-weight: 500;
- display: flex;
- align-items: center;
- gap: 12px;
- transition: all 0.2s ease;
- cursor: pointer;
- box-shadow:
- 0 0 0 1px rgba(19, 16, 16, 0.08),
- 0 6px 8px -4px rgba(19, 16, 16, 0.12),
- 0 4px 3px -2px rgba(19, 16, 16, 0.12),
- 0 1px 2px -1px rgba(19, 16, 16, 0.12);
-
- @media (max-width: 40rem) {
- box-shadow: 0 0 0 1px rgba(19, 16, 16, 0.16);
- }
-
- &:hover {
- background: var(--color-background);
- }
-
- &:active {
- transform: scale(0.98);
- box-shadow:
- 0 0 0 1px rgba(19, 16, 16, 0.08),
- 0 6px 8px -8px rgba(19, 16, 16, 0.5);
- }
- }
-
- @media (max-width: 60rem) {
- padding: 2rem 1.5rem;
- }
- }
-
- [data-component="faq"] {
- border-top: 1px solid var(--color-border-weak);
- padding: 4rem 5rem;
-
- @media (max-width: 60rem) {
- padding: 2rem 1.5rem;
- }
-
- [data-slot="section-title"] {
- margin-bottom: 24px;
-
- h3 {
- font-size: 16px;
- font-weight: 500;
- color: var(--color-text-strong);
- margin-bottom: 12px;
- }
-
- p {
- margin-bottom: 12px;
- color: var(--color-text);
- }
+ font-size: var(--mono-size);
+ font-weight: 400;
+ color: var(--text-weak);
}
ul {
- padding: 0;
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: var(--gutter);
+ }
+
+ /* The swatch, the name and role, then HEX, RGB and OKLCH to copy. Rows start at the top, so
+ every column's swatch, name and values line up. */
+ li {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ align-content: start;
+ min-width: 0;
+ }
+
+ /* The exact colour, which a browser's automatic dark mode must not alter. */
+ [data-slot="swatch"] {
+ display: block;
+ height: 6rem;
+ margin-bottom: 0.75rem;
+ color-scheme: only light;
+ }
+
+ [data-slot="title-row"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.25rem;
+ }
+
+ [data-slot="name"] {
+ font-family: var(--font-mono);
+ font-size: var(--mono-size);
+ white-space: nowrap;
+ }
+
+ /* Always two lines tall, so the value rows line up across the three swatches. */
+ [data-slot="use"] {
+ min-height: calc(2lh);
+ font-size: var(--fs-small);
+ line-height: 1.4;
+ color: var(--text-weak);
+ }
+
+ [data-slot="formats"] {
+ display: flex;
+ flex-direction: column;
+ margin-top: 0.75rem;
+ }
+
+ /* A whole row copies its value, with a grey tint across it on hover as in the legal lists. The
+ hairline and tint run the swatch's full width; the label is inset as far as the copy icon. */
+ [data-slot="format"] {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ align-items: center;
+ gap: 0 0.75rem;
+ padding: 0.375rem 0.5rem;
+ background: none;
+ box-shadow: inset 0 1px 0 var(--border);
+ text-align: start;
+ cursor: pointer;
+ transition: background-color 150ms ease;
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ background-color: var(--bg-weak);
+ }
+ }
+
+ &:focus-visible {
+ outline: 2px solid var(--link);
+ outline-offset: -2px;
+ background-color: var(--bg-weak);
+ }
+
+ &:active {
+ background-color: var(--bg-weaker);
+ }
+ }
+
+ [data-slot="format-name"] {
+ font-family: var(--font-mono);
+ font-size: var(--fs-meta);
+ color: var(--text-weak);
+ }
+
+ /* The value never breaks; if it can't fit beside its label it drops under it. */
+ [data-slot="value"] {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.375rem;
+ margin-inline-start: auto;
+ font-family: var(--font-mono);
+ font-size: var(--fs-small);
+ color: var(--text);
+ white-space: nowrap;
+
+ svg {
+ flex-shrink: 0;
+ width: 14px;
+ height: 14px;
+ }
+ }
+
+ /* Where a column would be narrower than about 240px: one colour per row. In the three columns the
+ big swatch stays on top, as a swatch beside the values would leave them too little room. */
+ @container (max-width: 46rem) {
+ ul {
+ grid-template-columns: minmax(0, 1fr);
+ gap: 1.5rem;
+ }
+
+ /* Two columns that every part shares: the name over a tall swatch on the left, the role over
+ the values on the right, so the role and the value rows start at one edge. The swatch is as
+ tall as the three value rows. */
+ li {
+ grid-template-columns: 5.5rem minmax(0, 1fr);
+ grid-template-rows: auto auto;
+ gap: 0.5rem 1rem;
+ }
+
+ [data-slot="title-row"] {
+ display: contents;
+ }
+
+ [data-slot="name"] {
+ grid-column: 1;
+ grid-row: 1;
+ }
+
+ [data-slot="use"] {
+ grid-column: 2;
+ grid-row: 1;
+ min-height: 0;
+ }
+
+ /* The labels line up with the role above them again, as in this layout it isn't inset. */
+ [data-slot="format"] {
+ padding-inline-start: 0;
+ }
+
+ [data-slot="swatch"] {
+ grid-column: 1;
+ grid-row: 2;
+ align-self: stretch;
+ height: auto;
+ margin: 0;
+ }
+
+ [data-slot="formats"] {
+ grid-column: 2;
+ grid-row: 2;
+ margin: 0;
+ }
+ }
+
+ /* Phones: the name on its own line, the role under it across the full width, then the swatch
+ beside its values. */
+ @container (max-width: 30rem) {
+ li {
+ grid-template-columns: 4rem minmax(0, 1fr);
+ grid-template-rows: auto auto auto;
+ row-gap: 0.25rem;
+ }
+
+ [data-slot="name"] {
+ grid-column: 1 / -1;
+ }
+
+ [data-slot="use"] {
+ grid-column: 1 / -1;
+ grid-row: 2;
+ margin-bottom: 0.5rem;
+ }
+
+ [data-slot="swatch"],
+ [data-slot="formats"] {
+ grid-row: 3;
+ }
+ }
+ }
+
+ [data-component="usage"] {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 2rem var(--gutter);
+
+ li {
+ display: flex;
+ flex-direction: column;
+ gap: 0.375rem;
+ min-width: 0;
+ }
+
+ :is(strong, h3, h4) {
+ font-family: var(--font-mono);
+ font-size: var(--mono-size);
+ font-weight: 400;
+ color: var(--text-strong);
+ }
+
+ span {
+ color: var(--text-weak);
+ line-height: 1.4;
+ }
+
+ [data-slot="figure"] {
+ aspect-ratio: 16 / 10;
+ display: grid;
+ place-items: center;
+ margin-bottom: 0.875rem;
+ background: var(--bg-weak);
+ }
+
+ /* Every sub-section title has the same 48px above it: after a figure (its 0.875rem margin and the
+ item's 0.375rem gap, plus 28px), or at the top of a row (the list's 2rem row gap, plus 16px). */
+ li > h3[id]:not(:first-child) {
+ margin-top: 28px;
+ }
+
+ /* "Minimum sizes" spans the row above its two figures. */
+ [data-slot="group-heading"] {
+ grid-column: 1 / -1;
+ margin-top: 16px;
+ margin-bottom: -1rem;
+ }
+
+ /* Settings › Stroke diagram "off" (the default) hides the "One stroke" figure; the clear-space
+ text still says what a stroke is. */
+ [data-slot="stroke"][data-hidden] {
+ display: none;
+ }
+
+ :is([data-slot="clear-space"], [data-slot="stroke"]) {
+ grid-column: 1 / -1;
+
+ [data-slot="figure"] {
+ aspect-ratio: auto;
+ padding: 2.5rem 1rem;
+ }
+ }
+
+ /* The logo's clear space above the wordmark's, each centred: their drawings are symmetric about
+ the logo and the wordmark, so those sit on the figure's centre line (snapLogos keeps them on
+ whole pixels). */
+ [data-slot="clear-space"] [data-slot="figure"] {
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ gap: 2.5rem;
+ }
+
+ /* Each minimum-size specimen stands alone at its real size: the artwork, its width marked under
+ it, then the size. The artwork sits on the bottom of a 24px row, so both specimens' marks and
+ labels line up. */
+ [data-slot="minimum"] {
+ display: grid;
+ grid-template-rows: 24px auto auto;
+ justify-items: center;
+ row-gap: 0.5rem;
+
+ svg {
+ display: block;
+ }
+
+ > :first-child {
+ align-self: end;
+ }
+ }
+
+ /* The measurement, as the other blue measurement labels on the page. */
+ [data-slot="value"] {
+ font-family: var(--font-mono);
+ font-size: var(--fs-micro);
+ color: var(--link);
+ }
+
+ [data-slot="dimension"] {
+ stroke: var(--link);
+ fill: none;
+ }
+ }
+
+ /* Settings › Stroke diagram: what one stroke is. Only the chosen style shows. */
+ [data-component="stroke-diagram"] {
+ > svg {
+ display: none;
+ max-width: 100%;
+ height: auto;
+ }
+
+ &[data-style="highlight"] > [data-variant="highlight"],
+ &[data-style="ruler"] > [data-variant="ruler"],
+ &[data-style="zoom"] > [data-variant="zoom"],
+ &[data-style="tiles"] > [data-variant="tiles"],
+ &[data-style="animated"] > [data-variant="animated"] {
+ display: block;
+ }
+
+ [data-slot="unit"] {
+ fill: color-mix(in srgb, var(--link) 12%, transparent);
+ stroke: var(--link);
+
+ &[data-source] {
+ fill: light-dark(
+ color-mix(in srgb, var(--link) 70%, transparent),
+ color-mix(in srgb, var(--link) 45%, transparent)
+ );
+ }
+ }
+
+ [data-slot="band"] {
+ fill: color-mix(in srgb, var(--link) 30%, transparent);
+ }
+
+ [data-slot="dimension"],
+ [data-slot="crop"] {
+ fill: none;
+ stroke: var(--link);
+ }
+
+ [data-slot="extension"] {
+ fill: none;
+ stroke: color-mix(in srgb, var(--link) 45%, transparent);
+ }
+
+ [data-slot="grid"] {
+ fill: none;
+ stroke: var(--border);
+ }
+
+ [data-slot="tile"] {
+ fill: none;
+ stroke: var(--border-strong);
+ }
+
+ [data-slot="space"] {
+ fill: none;
+ stroke: var(--border-strong);
+ stroke-dasharray: 4 4;
+ }
+
+ text {
+ font-family: var(--font-mono);
+ font-size: var(--fs-micro);
+ fill: var(--link);
+ }
+
+ [data-slot="note"] {
+ fill: var(--text-weak);
+ }
+
+ /* Animated: the stroke lifts out of the logo, steps one stroke left into the clear space and
+ settles, then the clear space and its measurement appear. Steps, not tweens. Reduced motion
+ shows the end state. */
+ [data-variant="animated"] {
+ [data-slot="lift"] {
+ transform-box: view-box;
+ }
+
+ :is([data-slot="space"], [data-late]) {
+ opacity: 0;
+ }
+ }
+
+ &[data-play] [data-variant="animated"] {
+ [data-slot="lift"] {
+ animation: stroke-step 1.8s steps(1, end) 0.3s both;
+ }
+
+ :is([data-slot="space"], [data-late]) {
+ animation: stroke-late 1.8s steps(1, end) 0.3s both;
+ }
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ [data-variant="animated"] {
+ [data-slot="lift"] {
+ animation: none !important;
+ translate: -24px 0;
+ }
+
+ :is([data-slot="space"], [data-late]) {
+ animation: none !important;
+ opacity: 1;
+ }
+ }
+ }
+ }
+
+ /* One blue layer: the stroke squares, leader and label in the measurement blue; the hatching,
+ guides and crop marks in lighter tints of it. */
+ [data-component="clear-space"] {
+ display: block;
+ max-width: 100%;
+ height: auto;
+
+ [data-slot="hatch"] {
+ stroke: color-mix(in srgb, var(--link) 28%, transparent);
+ stroke-width: 1;
+ }
+
+ [data-slot="outline"] {
+ fill: none;
+ stroke: color-mix(in srgb, var(--link) 40%, transparent);
+ }
+
+ [data-slot="crop"] {
+ fill: none;
+ stroke: color-mix(in srgb, var(--link) 55%, transparent);
+ }
+
+ [data-slot="unit"] {
+ fill: color-mix(in srgb, var(--link) 22%, transparent);
+ stroke: var(--link);
+
+ &[data-source] {
+ fill: light-dark(
+ color-mix(in srgb, var(--link) 70%, transparent),
+ color-mix(in srgb, var(--link) 40%, transparent)
+ );
+ }
+ }
+
+ [data-slot="leader"] {
+ fill: none;
+ stroke: var(--link);
+ }
+
+ [data-slot="leader-dot"] {
+ fill: var(--link);
+ }
+
+ text {
+ font-family: var(--font-mono);
+ font-size: var(--fs-micro);
+ fill: var(--link);
+ }
+ }
+
+ [data-component="brand-variant"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+
+ & + & {
+ margin-top: 3rem;
+ }
+
+ h3 {
+ font-family: var(--font-mono);
+ font-size: var(--mono-size);
+ font-weight: 400;
+ }
+
+ > p {
+ color: var(--text-weak);
+ line-height: 1.4;
+ margin-bottom: 0.75rem;
+ }
+
+ [data-slot="row"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+
+ & + & {
+ margin-top: 1.5rem;
+ }
+ }
+
+ h4 {
+ font-size: var(--fs-small);
+ font-weight: 400;
+ color: var(--text-strong);
+ }
+
+ [data-slot="preview"] {
+ &[data-variant="standard"][data-tone="light"] {
+ background: #f4f4f4;
+ }
+
+ /* Photo-like multicolor backgrounds: wide, heavily blurred color fields (the last listed field
+ lies at the bottom) with film grain on top. */
+ /* The picker's "Blur + grain": each field is a circle whose radius is a share of the tile's diagonal
+ (x 1.35 spread), written as an ellipse in a 2:1 tile. Only the grain blends; one mode per layer,
+ or the list repeats and overlays the color fields too. */
+ &[data-variant="transparent"][data-tone="light"] {
+ background:
+ var(--brand-grain), radial-gradient(67.9% 135.8% at 30% 100%, var(--brand-light-4), transparent),
+ radial-gradient(87.5% 175% at 62% 92%, var(--brand-light-3), transparent),
+ radial-gradient(83% 166% at 82% 18%, var(--brand-light-2), transparent),
+ radial-gradient(78.5% 157% at 18% 28%, var(--brand-light-1), transparent), var(--brand-light-base);
+ background-blend-mode: overlay, normal, normal, normal, normal;
+ }
+
+ &[data-variant="transparent"][data-tone="dark"] {
+ background:
+ var(--brand-grain), radial-gradient(90.5% 181% at 50% 105%, var(--brand-dark-3), transparent),
+ radial-gradient(83% 166% at 85% 30%, var(--brand-dark-2), transparent),
+ radial-gradient(75.5% 151% at 15% 25%, var(--brand-dark-1), transparent), var(--brand-dark-base);
+ background-blend-mode: overlay, normal, normal, normal;
+ }
+
+ &[data-variant="solid"] {
+ box-shadow: none;
+ }
+
+ &[data-variant="solid"][data-tone="light"][data-stop="0"] {
+ background: var(--brand-light-1);
+ }
+
+ &[data-variant="solid"][data-tone="light"][data-stop="1"] {
+ background: var(--brand-light-2);
+ }
+
+ &[data-variant="solid"][data-tone="dark"][data-stop="0"] {
+ background: var(--brand-dark-1);
+ }
+
+ &[data-variant="solid"][data-tone="dark"][data-stop="1"] {
+ background: var(--brand-dark-2);
+ }
+ }
+ }
+
+ /* Every card's buttons (assets, avatars, badges) share one size with /press: asset-buttons.css. */
+
+ /* Links in this page's own running text, the same as the site's inline links. */
+ :is([data-slot="text"], [data-slot="prose"], [data-slot="note"]) a {
+ color: var(--inline-link-color, var(--text-strong));
+ text-decoration: underline;
+ text-decoration-thickness: 1px;
+ text-underline-offset: 0.15em;
+ transition: color 150ms ease;
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ color: var(--link);
+ }
+ }
+
+ &:focus-visible,
+ &:active {
+ color: var(--link);
+ }
+ }
+
+ :is([data-slot="prose"], [data-slot="note"]) {
+ line-height: 1.5;
+ color: var(--text-weak);
+ }
+
+ /* Paragraphs that belong together keep the body's paragraph gap, not the section's. */
+ [data-slot="paragraphs"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ }
+
+ /* Every section's intro: the site's body size and colour, not the larger lead. */
+ [data-slot="text"] {
+ font-size: var(--body-size);
+ line-height: 1.5;
+ color: var(--text);
+ text-wrap: pretty;
+ }
+
+ /* Inline names and commands: OpenTUI Mono on a grey chip. */
+ code {
+ padding: 0.0625rem 0.3125rem;
+ background: var(--bg-weaker);
+ font-family: var(--font-mono);
+ font-size: calc(0.875em + 1px);
+ color: var(--text-strong);
+ box-decoration-break: clone;
+ }
+
+ [data-component="brand-sub"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.5rem;
+
+ h3 {
+ font-family: var(--font-mono);
+ font-size: var(--mono-size);
+ font-weight: 400;
+ color: var(--text-strong);
+ }
+
+ > p {
+ margin-bottom: 0.75rem;
+ line-height: 1.4;
+ color: var(--text-weak);
+ }
+
+ [data-slot="figure"] {
+ display: grid;
+ place-items: center;
+ padding: 2.5rem 1rem;
+ background: var(--bg-weak);
+ }
+ }
+
+ /* Partner lockups: OpenCode × a partner in light and dark tiles. */
+ [data-slot="lockups"] [data-slot="preview"] svg {
+ display: block;
+ max-width: 100%;
+ height: auto;
+ }
+
+ /* Badges: a row per style, as the logo and wordmark sections, with a Light and a Dark card side by
+ side (one column where two would be too narrow). Settings › Badge font shows the Inter, OpenTUI Mono
+ or uppercase OpenTUI Mono files. */
+ /* Straight after the description: its 12px margin and the 8px gap put the tabs about as far below
+ it as the cards sit below the tabs. */
+ [data-component="badges"] {
+ container-type: inline-size;
+
+ > [data-variant] {
+ display: none;
+ flex-direction: column;
+ gap: 1.5rem;
+ }
+
+ &[data-style="sans"] > [data-variant="sans"],
+ &[data-style="mono"] > [data-variant="mono"],
+ &[data-style="mono caps"] > [data-variant="mono caps"] {
+ display: flex;
+ }
+
+ /* Settings › Badge layout: only the chosen layout shows. */
+ [data-slot="tabs-layout"],
+ [data-slot="rows-layout"] {
+ display: none;
+ flex-direction: column;
+ gap: 1.5rem;
+ }
+
+ &[data-layout="tabs"] [data-slot="tabs-layout"],
+ &[data-layout="rows"] [data-slot="rows-layout"] {
+ display: flex;
+ }
+
+ [data-slot="tabs-layout"] {
+ gap: clamp(0.75rem, 1.5vw, 1.25rem);
+ }
+
+ /* The style tabs: plain text at the group title's size, the chosen style in ink and the others
+ muted (darker on hover); they wrap on narrow screens. */
+ [data-slot="style-tabs"] {
+ position: relative;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0 1.25rem;
+
+ button {
+ display: inline-flex;
+ align-items: center;
+ padding: 0.25rem 0;
+ background: none;
+ font-family: var(--font-mono);
+ font-size: var(--mono-size);
+ color: var(--text-weak);
+ cursor: pointer;
+ transition: color 150ms ease;
+
+ &[aria-selected="true"] {
+ color: var(--text-strong);
+ }
+
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ color: var(--text-strong);
+ }
+ }
+
+ &:active {
+ color: var(--text-strong);
+ }
+
+ &:focus-visible {
+ outline: 2px solid var(--link);
+ outline-offset: 2px;
+ }
+ }
+ }
+
+ [data-slot="tab-indicator"] {
+ display: none;
+ }
+
+ /* Settings › Badge tab style › underline: a 2px ink line under the chosen tab that slides to the
+ next one. */
+ &[data-tab-style="underline"] [data-slot="tab-indicator"] {
+ position: absolute;
+ top: 0;
+ inset-inline-start: 0;
+ display: block;
+ width: 0;
+ height: 2px;
+ background: var(--text-strong);
+ transition:
+ transform 200ms var(--ease-out),
+ width 200ms var(--ease-out);
+
+ @media (prefers-reduced-motion: reduce) {
+ transition: none;
+ }
+ }
+
+ /* Settings › Badge tab style › square: a 6px ink square before the chosen tab's label, about the
+ x-height. Every tab keeps the square's space, so the labels never move. */
+ &[data-tab-style="square"] [data-slot="style-tabs"] button {
+ &::before {
+ content: "";
+ width: 6px;
+ height: 6px;
+ margin-inline-end: 0.5rem;
+ background: transparent;
+ transition: background-color 150ms ease;
+ }
+
+ &[aria-selected="true"]::before {
+ background: var(--text-strong);
+ }
+ }
+
+ [data-slot="row"] {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ }
+
+ h4 {
+ font-size: var(--fs-small);
+ font-weight: 400;
+ color: var(--text-strong);
+ }
+
+ [data-slot="badge-grid"] {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 1.5rem var(--gutter);
li {
- list-style: none;
- margin-bottom: 24px;
- line-height: 200%;
-
- @media (max-width: 60rem) {
- line-height: 180%;
- }
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ min-width: 0;
}
}
- [data-slot="faq-question"] {
+ @container (min-width: 30rem) {
+ [data-slot="badge-grid"] {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+ }
+
+ [data-slot="preview"] {
+ position: relative;
+ display: grid;
+ place-items: center;
+ aspect-ratio: 2;
+
+ &[data-tone="light"] {
+ color-scheme: only light;
+ background: #f4f4f4;
+ --size-muted: #6b6b6b;
+ --size-strong: #1f1f1f;
+ }
+
+ &[data-tone="dark"] {
+ color-scheme: only dark;
+ background: #0a0a0a;
+ box-shadow: inset 0 0 0 1px var(--border);
+ --size-muted: #8f8f8f;
+ --size-strong: #eeeeee;
+ }
+
+ img {
+ display: block;
+ width: auto;
+ max-width: calc(100% - 1rem);
+ }
+
+ /* Cells: the tiles step away from the badge's grey cells (#eeeeee, #1f1f1f) so the cell edges
+ and the gap between them read. */
+ /* White, so a faint inset edge shows where the tile ends. */
+ &[data-badge="c"][data-tone="light"] {
+ background: #ffffff;
+ box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.1);
+ }
+
+ /* Sizes on #4f4f4f: #d0d0d0 is 5.3:1, white 8.2:1. */
+ &[data-badge="c"][data-tone="dark"] {
+ background: #4f4f4f;
+ --size-muted: #d0d0d0;
+ --size-strong: #ffffff;
+ }
+ }
+
+ /* The size switcher: plain mono text in the tile's top-left corner, shown while the tile is
+ hovered or holds focus, and always on touch screens. Muted sizes pass 4.5:1 on their tile. */
+ [data-slot="sizes"] {
+ position: absolute;
+ top: 0.25rem;
+ inset-inline-start: 0.25rem;
display: flex;
- gap: 16px;
- margin-bottom: 8px;
- color: var(--color-text-strong);
- font-weight: 500;
- cursor: pointer;
- background: none;
- border: none;
- padding: 0;
+ opacity: 0;
+ transition: opacity 150ms ease;
- [data-slot="faq-icon-plus"] {
- flex-shrink: 0;
- color: var(--color-text-weak);
- margin-top: 2px;
+ button {
+ padding: 0.25rem 0.375rem;
+ background: none;
+ font-family: var(--font-mono);
+ font-size: var(--fs-meta);
+ line-height: 1;
+ color: var(--size-muted);
+ cursor: pointer;
- [data-closed] & {
- display: block;
+ &[aria-pressed="true"] {
+ color: var(--size-strong);
}
- [data-expanded] & {
- display: none;
- }
- }
- [data-slot="faq-icon-minus"] {
- flex-shrink: 0;
- color: var(--color-text-weak);
- margin-top: 2px;
- [data-closed] & {
- display: none;
+ @media (hover: hover) and (pointer: fine) {
+ &:hover {
+ color: var(--size-strong);
+ }
}
- [data-expanded] & {
- display: block;
+
+ &:active {
+ color: var(--size-strong);
+ }
+
+ &:focus-visible {
+ outline: 1px solid var(--size-strong);
+ outline-offset: -1px;
}
- }
- [data-slot="faq-question-text"] {
- flex-grow: 1;
- text-align: left;
}
}
- [data-slot="faq-answer"] {
- margin-left: 40px;
- margin-bottom: 32px;
- color: var(--color-text);
+ [data-slot="preview"]:focus-within [data-slot="sizes"] {
+ opacity: 1;
+ }
+
+ @media (hover: hover) and (pointer: fine) {
+ [data-slot="preview"]:hover [data-slot="sizes"] {
+ opacity: 1;
+ }
+ }
+
+ [data-slot="preview"]:active [data-slot="sizes"] {
+ opacity: 1;
+ }
+
+ /* Touch: always shown, set further in from the corner and lower, and each size a real 44px tall
+ target (the whole box, inside the tile) with 8px between neighbours. */
+ @media (hover: none), (pointer: coarse) {
+ [data-slot="sizes"] {
+ top: 0;
+ inset-inline-start: 0.75rem;
+ gap: 0.5rem;
+ opacity: 1;
+
+ button {
+ display: inline-flex;
+ align-items: center;
+ min-width: 44px;
+ min-height: 44px;
+ padding: 0 0.625rem;
+ }
+ }
+ }
+
+ [data-slot="meta"] {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ justify-content: space-between;
+ gap: 0.5rem;
+ }
+
+ [data-slot="name"] {
+ font-family: var(--font-sans);
+ font-size: var(--fs-small);
+ color: var(--text-weak);
+ }
+
+ [data-slot="badge-actions"] {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ gap: 0.25rem;
+ margin-inline-start: auto;
+
+ > [data-component="site-button"] {
+ gap: 0.375rem;
+ }
}
}
- [data-component="legal"] {
- color: var(--color-text-weak);
- text-align: center;
- padding: 2rem 5rem;
- display: flex;
- gap: 32px;
- justify-content: center;
+ [data-component="partner-lockup"] {
+ display: block;
+ max-width: 100%;
+ height: auto;
- @media (max-width: 60rem) {
- padding: 2rem 1.5rem;
- }
-
- a {
- color: var(--color-text-weak);
- text-decoration: none;
- }
-
- a:hover {
- color: var(--color-text);
- text-decoration: underline;
+ /* The ×: two 1.5px lines in the logo's inner shade (#d2d2d2 on the light tile, #4b4b4b on the
+ dark). */
+ [data-slot="times"] {
+ fill: none;
+ stroke: var(--logo-inner);
+ stroke-width: 1.5;
}
}
- a {
- color: var(--color-text-strong);
- text-decoration: underline;
- text-underline-offset: 2px;
- text-decoration-thickness: 1px;
+ [data-slot="defs"] {
+ position: absolute;
+ }
- &:hover {
- text-decoration-thickness: 2px;
+ [data-component="brand-dont-grid"] {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 1.5rem var(--gutter);
+
+ [data-slot="preview"] {
+ position: relative;
+ aspect-ratio: 2;
+ display: grid;
+ place-items: center;
+ background: var(--bg-weak);
+
+ > svg[data-slot="mark"] {
+ width: 48px;
+ height: 60px;
+ }
+
+ > svg[data-slot="wordmark"] {
+ width: 156px;
+ height: 28px;
+ }
+
+ &[data-example="low-contrast"] {
+ background: #b0b0b0;
+ }
+
+ &[data-example="color"] {
+ background: var(--brand-dark-2);
+ }
+
+ /* 140% wide. */
+ &[data-example="stretch"] svg {
+ transform: scaleX(1.4);
+ }
+
+ &[data-example="shadow"] svg {
+ filter: drop-shadow(4px 6px 3px light-dark(rgb(0 0 0 / 0.5), rgb(255 255 255 / 0.35)));
+ }
+
+ &[data-example="glow"] svg {
+ filter: drop-shadow(0 0 1px #22d3ee) drop-shadow(0 0 8px #22d3ee);
+ }
+ }
+
+ [data-slot="lockup"] {
+ display: flex;
+ align-items: center;
+ gap: 0.75rem;
+
+ svg {
+ display: block;
+ width: 32px;
+ height: 40px;
+ }
+
+ span {
+ font-family: var(--font-sans);
+ font-size: 1.75rem;
+ font-weight: 600;
+ letter-spacing: -0.02em;
+ color: var(--logo-code);
+ }
+ }
+ }
+
+ /* Shared by the don'ts and the whole-pixel Do and Don't figures. */
+ :is([data-component="brand-dont-grid"], [data-component="brand-pixels"]) {
+ figure {
+ display: flex;
+ flex-direction: column;
+ gap: 0.75rem;
+ min-width: 0;
+ margin: 0;
+ }
+
+ /* The verdict, then the caption on the same line; a long caption wraps under itself, not under the verdict. */
+ /* One sentence that starts with "Do" or "Do not": it wraps under its first word, not beside it. */
+ figcaption {
+ color: var(--text-weak);
+ line-height: 1.4;
+ }
+
+ /* "Do" and "Do not" read as the start of the rule: same face and size, only the colour differs. */
+ [data-slot="verdict"] {
+ font: inherit;
+ }
+
+ [data-verdict="dont"] [data-slot="verdict"] {
+ color: var(--brand-dont);
+ }
+
+ [data-verdict="do"] [data-slot="verdict"] {
+ color: var(--brand-do);
+ }
+ }
+
+ [data-component="brand-pixels"] {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 1.5rem var(--gutter);
+ margin-bottom: 0.875rem;
+
+ [data-slot="preview"] {
+ display: grid;
+ place-items: center;
+ padding: 1.5rem 0;
+ background: var(--bg-weak);
+ }
+
+ /* The grid at the largest whole-pixel cell that fits its figure: 16px cells need 340px, 12px
+ cells 268px, 8px cells 196px. */
+ [data-slot="preview"] {
+ container-type: inline-size;
+ }
+
+ :is([data-cell="12"], [data-cell="8"]) {
+ display: none;
+ }
+
+ @container (max-width: 339px) {
+ [data-cell="16"] {
+ display: none;
+ }
+
+ [data-cell="12"] {
+ display: block;
+ }
+ }
+
+ @container (max-width: 267px) {
+ [data-cell="12"] {
+ display: none;
+ }
+
+ [data-cell="8"] {
+ display: block;
+ }
+ }
+ }
+
+ [data-component="pixel-grid"] {
+ display: block;
+
+ [data-slot="grid"] {
+ fill: none;
+ stroke: var(--border);
+ }
+
+ [data-slot="dimension"] {
+ fill: none;
+ stroke: var(--link);
+ }
+
+ text {
+ font-family: var(--font-mono);
+ font-size: var(--fs-micro);
+ fill: var(--link);
+ }
+ }
+
+ [data-component="usage"] [data-slot="pixels"] {
+ grid-column: 1 / -1;
+
+ /* The logo and wordmark size tables each take half the width, filling the row. */
+ [data-slot="sizes"] {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ align-items: start;
+ gap: 0.75rem var(--gutter, 2rem);
+ /* With the list's 0.375rem gap, 20px after the text, as between other sub-sections' text and
+ their figures. */
+ margin-top: 0.875rem;
+ }
+
+ table {
+ width: 100%;
+ border-collapse: collapse;
+ font-family: var(--font-mono);
+ font-size: var(--fs-small);
+ font-variant-numeric: tabular-nums;
+ }
+
+ th {
+ font-weight: 400;
+ text-align: start;
+ color: var(--text-strong);
+ }
+
+ td {
+ color: var(--text-weak);
+ }
+
+ :is(th, td) {
+ padding-block: 0.25rem;
+ padding-inline: 0 2rem;
+ border-bottom: 1px solid var(--border);
+ }
+ }
+
+ @media (max-width: 40rem) {
+ [data-component="brand-dont-grid"],
+ [data-component="brand-pixels"],
+ [data-component="brand-tiles"] {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ [data-component="usage"] {
+ grid-template-columns: minmax(0, 1fr);
+ }
+ }
+
+ /* The logo and wordmark size tables need about 396px in two equal columns (the wider one is 190px),
+ and the two-across rule outranks the phone rule above, so under 448px they stack (at 320px they
+ overlapped by 10px and "Stroke" was cut off; at 410px the second ran 17px past the row). */
+ @media (max-width: 28rem) {
+ [data-component="usage"] [data-slot="pixels"] [data-slot="sizes"] {
+ grid-template-columns: minmax(0, 1fr);
}
}
}
+
+/* Brand only: a tighter gap under each section title (12px; 14px on phones, keeping their +2px), so the
+ title groups with its text while the 72px above it stays clearly larger. The shared 24px
+ (on-this-page.css) stays for Press, legal and the product pages. */
+[data-site][data-page="brand"] {
+ --heading-gap: 12px;
+
+ @media (max-width: 40rem) {
+ --heading-gap: 14px;
+ }
+}
+
+/* Scrolling (set by the page for 150ms after each scroll): hover states wait, so rows and tiles don't
+ light up one by one as they pass under a resting pointer. Pointers that hover only: on touch it
+ would swallow a tap made just after a scroll stops. */
+@media (hover: hover) and (pointer: fine) {
+ html[data-scrolling] [data-page="brand"] [data-component="content"] {
+ pointer-events: none;
+ }
+}
+
+/* Settings › Brand colours › blue + clay: the Default and Simple fields in on-brand blues (the
+ Simple tiles still take the first two light and dark fields, in order). The slate and clay
+ defaults above stay for "clay + slate". */
+[data-page="brand"] [data-palette="blue"] {
+ --brand-light-1: #b9caff;
+ --brand-light-2: #d5e0ff;
+ --brand-light-3: #c7d3f4;
+ --brand-light-4: #e4ebff;
+ --brand-light-base: #f3f6ff;
+ --brand-dark-1: #2c4bd6;
+ --brand-dark-2: #142a6b;
+ --brand-dark-3: #1d3aa6;
+ --brand-dark-base: #070b1a;
+}
+
+/* Settings › Variant background: what sits behind the Default (transparent) tiles (default "mesh").
+ "flat" keeps the faint blurred fields above; the others build on the same palette fields, CSS only. The logo stays
+ centred on whole pixels above them. */
+[data-page="brand"] [data-variant-background] [data-slot="preview"][data-variant="transparent"] {
+ position: relative;
+ isolation: isolate;
+
+ > img {
+ position: relative;
+ }
+}
+
+/* Two close tints of the blue: a soft diagonal with a lighter glow in one corner. */
+[data-page="brand"] [data-variant-background="gradient"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ radial-gradient(90% 120% at 15% 10%, var(--brand-light-4), transparent 70%),
+ linear-gradient(150deg, var(--brand-light-2), var(--brand-light-1));
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ radial-gradient(90% 120% at 85% 10%, var(--brand-dark-3), transparent 70%),
+ linear-gradient(150deg, var(--brand-dark-1), var(--brand-dark-2));
+ background-blend-mode: normal;
+ }
+}
+
+/* A plain fill under strong film grain, like a photo of a coloured wall. */
+[data-page="brand"] [data-variant-background="grain"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ var(--brand-grain) 0 0 / 120px,
+ var(--brand-light-1);
+ background-blend-mode: overlay, normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ var(--brand-grain) 0 0 / 120px,
+ var(--brand-dark-1);
+ background-blend-mode: soft-light, normal;
+ }
+}
+
+/* Soft out-of-focus shapes: a bright highlight, a deeper shadow and two mid tones, then grain. */
+[data-page="brand"] [data-variant-background="photo-like"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ var(--brand-grain), radial-gradient(30% 55% at 78% 30%, rgb(255 255 255 / 0.9), transparent),
+ radial-gradient(45% 80% at 22% 85%, color-mix(in oklab, var(--brand-dark-1) 45%, transparent), transparent),
+ radial-gradient(55% 100% at 18% 15%, var(--brand-light-1), transparent),
+ radial-gradient(60% 110% at 90% 95%, var(--brand-light-3), transparent), var(--brand-light-2);
+ background-blend-mode: overlay, normal, normal, normal, normal, normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ var(--brand-grain),
+ radial-gradient(28% 50% at 75% 28%, color-mix(in oklab, var(--brand-dark-1), white 35%), transparent),
+ radial-gradient(50% 90% at 20% 20%, var(--brand-dark-1), transparent),
+ radial-gradient(55% 100% at 85% 100%, var(--brand-dark-3), transparent),
+ radial-gradient(40% 70% at 10% 95%, var(--brand-dark-base), transparent), var(--brand-dark-2);
+ background-blend-mode: overlay, normal, normal, normal, normal, normal;
+ }
+}
+
+/* A gradient with a 2px pixel checker that fades across it, in the site's pixel style. The 4px
+ tile keeps every square on whole pixels at 1× and 2×. */
+[data-page="brand"] [data-variant-background="dither"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background-blend-mode: normal;
+ background: linear-gradient(90deg, var(--brand-light-1), var(--brand-light-4));
+ --dither: color-mix(in oklab, var(--brand-dark-1) 22%, transparent);
+ }
+
+ &[data-tone="dark"] {
+ background-blend-mode: normal;
+ background: linear-gradient(90deg, var(--brand-dark-1), var(--brand-dark-2));
+ --dither: rgb(255 255 255 / 0.12);
+ }
+
+ &::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ background: repeating-conic-gradient(var(--dither) 0 25%, transparent 0 50%) 0 0 / 4px 4px;
+ mask-image: linear-gradient(90deg, transparent 15%, #000);
+ }
+}
+
+/* Faint 24px module lines over a fill, as on the font page: a 24px SVG tile with a 1px line on its
+ top and left edge, so both directions land on whole pixels. */
+[data-page="brand"] [data-variant-background="grid"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h24v1H1v23H0z' fill='%232c4bd6' fill-opacity='.16'/%3E%3C/svg%3E")
+ 0 0 / 24px 24px,
+ var(--brand-light-2);
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'%3E%3Cpath d='M0 0h24v1H1v23H0z' fill='%23fff' fill-opacity='.1'/%3E%3C/svg%3E")
+ 0 0 / 24px 24px,
+ var(--brand-dark-2);
+ background-blend-mode: normal;
+ }
+}
+
+/* Mesh (default): soft colour from each corner and a lighter centre, like a mesh gradient. No
+ texture, so the logo's see-through shade reads as a clean tint of whatever is behind it. */
+[data-page="brand"] [data-variant-background="mesh"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ radial-gradient(60% 90% at 50% 50%, var(--brand-light-base), transparent),
+ radial-gradient(70% 120% at 0% 0%, var(--brand-light-1), transparent),
+ radial-gradient(70% 120% at 100% 0%, var(--brand-light-4), transparent),
+ radial-gradient(70% 120% at 100% 100%, var(--brand-light-3), transparent),
+ radial-gradient(
+ 70% 120% at 0% 100%,
+ color-mix(in oklab, var(--brand-light-1), var(--brand-dark-1) 20%),
+ transparent
+ ),
+ var(--brand-light-2);
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ radial-gradient(60% 90% at 50% 50%, color-mix(in oklab, var(--brand-dark-1), var(--brand-dark-2)), transparent),
+ radial-gradient(70% 120% at 0% 0%, var(--brand-dark-1), transparent),
+ radial-gradient(70% 120% at 100% 0%, var(--brand-dark-3), transparent),
+ radial-gradient(70% 120% at 100% 100%, var(--brand-dark-base), transparent),
+ radial-gradient(70% 120% at 0% 100%, var(--brand-dark-2), transparent), var(--brand-dark-2);
+ background-blend-mode: normal;
+ }
+}
+
+/* Aurora: soft diagonal bands of the palette blues. */
+[data-page="brand"] [data-variant-background="aurora"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background: linear-gradient(
+ 115deg,
+ var(--brand-light-2) 0%,
+ var(--brand-light-1) 28%,
+ var(--brand-light-base) 48%,
+ var(--brand-light-3) 68%,
+ var(--brand-light-1) 100%
+ );
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background: linear-gradient(
+ 115deg,
+ var(--brand-dark-2) 0%,
+ var(--brand-dark-1) 30%,
+ var(--brand-dark-base) 50%,
+ var(--brand-dark-3) 72%,
+ var(--brand-dark-2) 100%
+ );
+ background-blend-mode: normal;
+ }
+}
+
+/* Spotlight: one soft light from the top left, darker towards the far edges. */
+[data-page="brand"] [data-variant-background="spotlight"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background: radial-gradient(
+ 90% 160% at 15% 0%,
+ var(--brand-light-base),
+ var(--brand-light-1) 55%,
+ color-mix(in oklab, var(--brand-light-1), var(--brand-dark-1) 25%) 100%
+ );
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background: radial-gradient(
+ 90% 160% at 15% 0%,
+ color-mix(in oklab, var(--brand-dark-1), white 15%),
+ var(--brand-dark-1) 40%,
+ var(--brand-dark-base) 100%
+ );
+ background-blend-mode: normal;
+ }
+}
+
+/* Halftone: 1.5px dots on a 6px grid that fade in across a soft gradient. */
+[data-page="brand"] [data-variant-background="halftone"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background: linear-gradient(90deg, var(--brand-light-4), var(--brand-light-1));
+ background-blend-mode: normal;
+ --dot: color-mix(in oklab, var(--brand-dark-1) 45%, transparent);
+ }
+
+ &[data-tone="dark"] {
+ background: linear-gradient(90deg, var(--brand-dark-2), var(--brand-dark-1));
+ background-blend-mode: normal;
+ --dot: color-mix(in oklab, var(--brand-light-1) 35%, transparent);
+ }
+
+ &::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ background: radial-gradient(circle, var(--dot) 0.75px, transparent 1.25px) 0 0 / 6px 6px;
+ mask-image: linear-gradient(90deg, transparent 10%, #000 90%);
+ }
+}
+
+/* Isometric: faint 2:1 pixel-art isometric lines from a 32 × 16px SVG tile, stepped on whole pixels. */
+[data-page="brand"] [data-variant-background="isometric"] [data-slot="preview"][data-variant="transparent"] {
+ &[data-tone="light"] {
+ background:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M0 8L16 0L32 8L16 16Z' fill='none' stroke='%232c4bd6' stroke-opacity='.18'/%3E%3C/svg%3E")
+ 0 0 / 32px 16px,
+ linear-gradient(160deg, var(--brand-light-4), var(--brand-light-2));
+ background-blend-mode: normal;
+ }
+
+ &[data-tone="dark"] {
+ background:
+ url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' shape-rendering='crispEdges'%3E%3Cpath d='M0 8L16 0L32 8L16 16Z' fill='none' stroke='%23fff' stroke-opacity='.1'/%3E%3C/svg%3E")
+ 0 0 / 32px 16px,
+ linear-gradient(160deg, var(--brand-dark-1), var(--brand-dark-2));
+ background-blend-mode: normal;
+ }
+}
+
+@keyframes stroke-step {
+ 0% {
+ translate: 0 0;
+ }
+ 25% {
+ translate: 0 -8px;
+ }
+ 50% {
+ translate: -24px -8px;
+ }
+ 75%,
+ 100% {
+ translate: -24px 0;
+ }
+}
+
+@keyframes stroke-late {
+ 0%,
+ 74% {
+ opacity: 0;
+ }
+ 75%,
+ 100% {
+ opacity: 1;
+ }
+}
+
+/* The hero's subtitle spans the content column, like the sections under it. */
+[data-site][data-page="brand"] [data-component="hero"] p {
+ max-width: none;
+}
diff --git a/packages/console/app/src/routes/brand/index.tsx b/packages/console/app/src/routes/brand/index.tsx
index 145ca1aa3e3..909f62c2096 100644
--- a/packages/console/app/src/routes/brand/index.tsx
+++ b/packages/console/app/src/routes/brand/index.tsx
@@ -1,317 +1,1850 @@
+import { Marked } from "~/component/site/marked"
+import { onCloseMenus } from "~/component/site/menu-open"
import "./index.css"
import { Title, Meta } from "@solidjs/meta"
-import { Header } from "~/component/header"
-import { Footer } from "~/component/footer"
-import { Legal } from "~/component/legal"
-import { useI18n } from "~/context/i18n"
+import {
+ createEffect,
+ createMemo,
+ createSignal,
+ For,
+ Match,
+ on,
+ onCleanup,
+ onMount,
+ Show,
+ Switch,
+ type JSX,
+} from "solid-js"
import { LocaleLinks } from "~/component/locale-links"
-import { SocialMeta } from "~/component/social-meta"
-import previewLogoLight from "../../asset/brand/preview-opencode-logo-light.png"
-import previewLogoDark from "../../asset/brand/preview-opencode-logo-dark.png"
-import previewLogoLightSquare from "../../asset/brand/preview-opencode-logo-light-square.png"
-import previewLogoDarkSquare from "../../asset/brand/preview-opencode-logo-dark-square.png"
-import previewWordmarkLight from "../../asset/brand/preview-opencode-wordmark-light.png"
-import previewWordmarkDark from "../../asset/brand/preview-opencode-wordmark-dark.png"
-import previewWordmarkSimpleLight from "../../asset/brand/preview-opencode-wordmark-simple-light.png"
-import previewWordmarkSimpleDark from "../../asset/brand/preview-opencode-wordmark-simple-dark.png"
-import logoLightPng from "../../asset/brand/opencode-logo-light.png"
-import logoDarkPng from "../../asset/brand/opencode-logo-dark.png"
-import logoLightSquarePng from "../../asset/brand/opencode-logo-light-square.png"
-import logoDarkSquarePng from "../../asset/brand/opencode-logo-dark-square.png"
-import wordmarkLightPng from "../../asset/brand/opencode-wordmark-light.png"
-import wordmarkDarkPng from "../../asset/brand/opencode-wordmark-dark.png"
-import wordmarkSimpleLightPng from "../../asset/brand/opencode-wordmark-simple-light.png"
-import wordmarkSimpleDarkPng from "../../asset/brand/opencode-wordmark-simple-dark.png"
-import logoLightSvg from "../../asset/brand/opencode-logo-light.svg"
-import logoDarkSvg from "../../asset/brand/opencode-logo-dark.svg"
-import logoLightSquareSvg from "../../asset/brand/opencode-logo-light-square.svg"
-import logoDarkSquareSvg from "../../asset/brand/opencode-logo-dark-square.svg"
-import wordmarkLightSvg from "../../asset/brand/opencode-wordmark-light.svg"
-import wordmarkDarkSvg from "../../asset/brand/opencode-wordmark-dark.svg"
-import wordmarkSimpleLightSvg from "../../asset/brand/opencode-wordmark-simple-light.svg"
-import wordmarkSimpleDarkSvg from "../../asset/brand/opencode-wordmark-simple-dark.svg"
-const brandAssets = "/opencode-brand-assets.zip"
+import { ShareMeta } from "~/component/share-meta"
+import { ogImage } from "~/lib/og"
+import { breadcrumbData, JsonLd } from "~/component/structured-data"
+import { useLanguage } from "~/context/language"
+import { englishText, localize } from "~/i18n/content"
+import { source } from "~/i18n/content/source"
+import { Site } from "~/component/site/site"
+import { useI18n } from "~/context/i18n"
+import {
+ badgeFile,
+ badgeHtml,
+ badgeMarkdown,
+ badgeZip,
+ brandContent,
+ brandMarkdown,
+ colorFormats,
+ type BadgeFont,
+} from "~/lib/brand-content"
+import { useMarkdown } from "~/component/site/use-markdown"
+import { siteSettings } from "~/component/site/settings"
+import { ContentsMenu, OnThisPage, SectionHeading, slug } from "~/component/site/on-this-page"
+import { PageTitle } from "~/component/site/sticky-title"
+import { AgentRulesButton } from "~/component/site/agent-rules-button"
+import { inlineKey } from "~/lib/direction"
export default function Brand() {
const i18n = useI18n()
- const alt = i18n.t("brand.meta.description")
- const downloadFile = async (url: string, filename: string) => {
- try {
- const response = await fetch(url)
- const blob = await response.blob()
- const blobUrl = window.URL.createObjectURL(blob)
+ const language = useLanguage()
+ const [copied, setCopied] = createSignal()
+ const content = createMemo(() => localize(language.locale(), "brand", brandContent(i18n.t)))
+ // Heading ids stay English in every locale, so links to /brand#naming keep working.
+ const english = createMemo(() => englishText(content(), source.brand))
+ const anchor = (text: string) => slug(english().get(text) ?? text)
+ const lower = (text: string) => (language.locale() === "en" ? text.toLowerCase() : text)
+ // A tone ("light", "dark") in the page's language, lower case in English as in a sentence.
+ const tone = (value: string) => lower(themeName(value))
+ const themeName = (value: string) => i18n.t(value === "dark" ? "site.theme.dark" : "site.theme.light")
+ const markdown = useMarkdown("/brand", brandMarkdown)
- const link = document.createElement("a")
- link.href = blobUrl
- link.download = filename
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
+ // The sections in page order, for the "Contents" list.
+ const sections = createMemo(() =>
+ [
+ content().naming.title,
+ ...content().families.map((family) => family.title),
+ content().variants.title,
+ content().colors.title,
+ content().usage.title,
+ content().donts.title,
+ content().integrations.title,
+ content().trademarks.title,
+ ].map((title) => ({ id: anchor(title), title })),
+ )
- window.URL.revokeObjectURL(blobUrl)
- } catch (error) {
- console.error("Download failed:", error)
- const link = document.createElement("a")
- link.href = url
- link.target = "_blank"
- link.rel = "noopener noreferrer"
- document.body.appendChild(link)
- link.click()
- document.body.removeChild(link)
+ // Translated labels change length: refit the drawings around them once the new text has rendered.
+ createEffect(on(language.locale, () => requestAnimationFrame(() => (fitDrawings(), snapLogos())), { defer: true }))
+
+ onMount(() => {
+ // While the page scrolls, rows passing under a resting pointer would light up one after another
+ // (a flicker). The content ignores the pointer until scrolling has stopped for 150ms.
+ const state: { idle?: ReturnType } = {}
+ const scrolling = () => {
+ document.documentElement.dataset.scrolling = ""
+ clearTimeout(state.idle)
+ state.idle = setTimeout(() => delete document.documentElement.dataset.scrolling, 150)
}
+ window.addEventListener("scroll", scrolling, { passive: true })
+ onCleanup(() => {
+ window.removeEventListener("scroll", scrolling)
+ clearTimeout(state.idle)
+ delete document.documentElement.dataset.scrolling
+ })
+ const observer = new ResizeObserver(snapLogos)
+ observer.observe(document.documentElement)
+ void document.fonts.ready.then(() => {
+ fitDrawings()
+ snapLogos()
+ })
+ // The animated stroke diagram plays once, when it first comes into view.
+ const play = new IntersectionObserver(
+ (entries) => {
+ entries
+ .filter((entry) => entry.isIntersecting)
+ .forEach((entry) => {
+ ;(entry.target as HTMLElement).dataset.play = ""
+ play.unobserve(entry.target)
+ })
+ },
+ { threshold: 0.6 },
+ )
+ document.querySelectorAll('[data-component="stroke-diagram"]').forEach((element) => play.observe(element))
+ onCleanup(() => {
+ observer.disconnect()
+ play.disconnect()
+ })
+ })
+
+ /** Copies text, or the text a URL serves, and marks `key` as copied for a moment. */
+ const copy = (key: string, value: string | { url: string }) => {
+ // A promised ClipboardItem keeps the click's user activation while the file loads (Safari needs it).
+ void (typeof value === "string"
+ ? navigator.clipboard.writeText(value)
+ : navigator.clipboard.write([
+ new ClipboardItem({
+ "text/plain": fetch(value.url)
+ .then((response) => response.text())
+ .then((text) => new Blob([text], { type: "text/plain" })),
+ }),
+ ]))
+ setCopied(key)
+ setTimeout(() => setCopied((current) => (current === key ? undefined : current)), 1500)
}
- return (
-
- {i18n.t("brand.title")}
-
-
-
-
-
+ /** A section or sub-section heading: a plain title that copies its section's address when clicked. */
+ const Heading = (props: { level: 2 | 3; id: string; children: string; label?: boolean }) => (
+
+ )
-
-
- {i18n.t("brand.heading")}
- {i18n.t("brand.subtitle")}
-