1import { Controller } from "@hotwired/stimulus" 2 3// Single-entry map â matches PreferencesController::FONTS. The whole 4// site renders Noto Sans (self-hosted via google_fonts.css). To 5// reintroduce per-user font variation, add entries here keyed by the 6// same slug used in the Ruby FONTS hash. 7const FONT_STACKS = { 8 noto_sans: '"Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif' 9} 10 11export default class extends Controller { 12 previewTheme(event) { 13 document.documentElement.setAttribute("data-theme", event.target.value) 14 } 15 16 previewFont(event) { 17 const stack = FONT_STACKS[event.target.value] 18 if (stack) document.documentElement.style.setProperty("--app-font", stack) 19 } 20 21 previewFontSize(event) { 22 const px = parseInt(event.target.value, 10) 23 if (px >= 10 && px <= 30) document.documentElement.style.fontSize = px + "px" 24 } 25}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.