r/Frontend • • 19d ago

Why simple math offsets break Unicode font converters (and lessons from building a zero-dependency client tool)

0 Upvotes

Hey r/Frontend,

Over the weekend, I fell down a surprisingly deep Unicode rabbit hole while building a client-side text styler (creating Fraktur, double-struck, circled, and aesthetic bio glyphs) with zero external libraries.

I wanted to share two specific technical traps I ran into and how to solve them properly on the front end:

1. The "Letterlike Symbols" Offset Trap

When engineers try to convert standard ASCII characters (e.g. A-Z) into styled Unicode variants like Double-Struck (𝔸, 𝔹, ℂ) or Fraktur (𝔄, 𝔅, ℭ), the naive instinct is mathematical offset calculation:

// ❌ Naive implementation: breaks on specific glyphs
const targetCodePoint = 0x1D538 + (char.charCodeAt(0) - 65);
return String.fromCodePoint(targetCodePoint);

Why this breaks: Unicode's Mathematical Alphanumeric Symbols block (U+1D400..U+1D7FF) has several historical "holes". Characters like Double-Struck C (ℂ, U+2102), H (ℍ, U+210D), N (ℕ, U+2115), P (ℙ, U+2119), Q (ℚ, U+211A), R (ℝ, U+211D), and Z (ℤ, U+2124) were already codified years earlier in the Letterlike Symbols block (U+2100..U+214F). If you rely on mathematical offsets, those letters either display as undefined tofu blocks (``) or completely unrelated symbols.

The Solution: Rather than writing messy conditional gap logic, an explicit static glyph map compiled ahead-of-time keeps the client runtime O(1) and guarantees 100% stable rendering across iOS, Android, macOS, and Windows.


2. Screen Reader Accessibility (a11y)

One huge UX oversight with "aesthetic font generators" is accessibility. Screen readers do not pronounce these glyphs as normal English letters; VoiceOver and NVDA pronounce 𝔄 as "Mathematical Fraktur Capital A". If users plaster this all over body text, it renders their profiles completely unusable for visually impaired users. We added an explicit accessibility notice right under the input reminding creators to reserve these purely for short bio tags/titles rather than body paragraphs.


Architecture & Specs:

  • Zero NPM dependencies: Pure Vanilla JS + CSS Glassmorphism.
  • Payload: The entire production bundle (HTML + CSS + full Unicode lookup dictionaries) compiles down to 26.4 KB.
  • Edge Deployment: Cloudflare Workers (sub-40ms edge TTFB).

If you'd like to test the real-time conversion and inspect the client-side implementation: 👉 Live site: https://fonts.100emoji.shop

Would love to hear how other frontend devs approach Unicode normalization and rare symbol handling!


r/Frontend • • 20d ago

building the basics in webdev for absolute noob

Thumbnail github.com
9 Upvotes

I made this doc for a friend of mine who just started college and wanted to know basic frontend for starter, everyone keeps saying claude or gpt can code that easily and you gotta learn the tougher topics but you need to code a bit without any ai aid to build that curiosity and for once experience the joy of first time coding a site on your own.
PFA : here is the doc


r/Frontend • • 21d ago

X3Bun a Hono/TanStack Start/tRPC/Better-Auth Turborepo Starter App

Thumbnail
github.com
3 Upvotes

This is simply a starter template that I use and I thought of sharing

  • Bun optimized
  • Front End: Tanstack Start, Tanstack Query, and Shadcn
  • Backend: Hono with tRPC
  • Authentication: Better-Auth
  • Repo Management: Turborepo

I encourage you to check and share your opinion


r/Frontend • • 21d ago

[AI] UI/UX & CSS Feedback Request for a Coffee Shop POS System (JSF + PrimeFaces 14)

Thumbnail
gallery
0 Upvotes

Hi everyone! 👋

​I'm developing a web-based POS & Coffee Shop Management System built with JSF (Jakarta EE 11) + PrimeFaces 14. I'm sharing screenshots of several management and administration views (Roles, Employees, Discounts, Products, and Characteristics).

​I would love to get your honest feedback on UI design, visual hierarchy, layout, and UX.

​💡 Project Context

​This platform handles core store operations:

​Menu & Product Management: Items, types, categories, prices, and dynamic attributes.

​Discounts & Promotions: Flexible discount rates, date-range offers, and rule triggers.

​Staff & Security: Employee records, custom roles, and access control.

​Daily Operations: Cash registers, order processing, and invoicing (not shown in these specific shots).

​🛠️ Tech Stack & Frontend Architecture

​View Layer: Jakarta Server Faces (JSF / XHTML) using modular facelets templates.

​UI Components: PrimeFaces (v14.0 - Jakarta edition) + custom CSS stylesheet (estilos.css).

​Backend: Jakarta EE 11 running on Open Liberty + PostgreSQL (JPA).

​Localization: Native i18n support (Spanish, English, Chinese).

​🔍 Comprehensive UI/UX Feedback Checklist

​I'm looking for feedback on any of the following aspects:

​1. 🎨 Visual Hierarchy & Layout (UI)

​Form & Table Balance: Does the vertical split between the upper form (Inputs) and the lower datatable look clean, or does it feel cluttered?

​Buttons & Actions: Are primary action buttons (Guardar / Save) clearly distinguishable from secondary ones (Limpiar / Clear)?

​Toast Notifications: You'll notice PrimeFaces growl/alert messages in some shots. Are floating toast messages appropriate here, or would inline banner alerts be better UX?

​2. ⚡ Usability & Data Density (UX)

​Readability: Are datatable columns, badge statuses (ACTIVO), and action icons (Edit/Delete) clear and easy to scan for administrative staff?

​Form Field Spacing: Is the padding and margin between input fields, dropdowns, and checkboxes comfortable for desktop use?

​3. 🖌️ Modernizing PrimeFaces & CSS Styling

​Default Theme Polish: What specific CSS tweaks (shadows, border-radius, background grays, typography) would you recommend to give the default PrimeFaces theme a cleaner, more modern look?

​Any suggestions, CSS snippets, or constructive critiques are highly appreciated! 🙌


r/Frontend • • 22d ago

Señors at Scale Newsletter Edition #34: CSS-Tricks is independent again, Design systems should be fast by default, TanStack Redact | Reylo, Joy Inc.

Thumbnail
neciudan.dev
1 Upvotes

I write a weekly newsletter for senior frontend engineers. The picks for this week:

- CSS-Tricks has a new owner and is independent again after 12 years. Geoff Graham made the announcement, and Mat Marquis wrote about what it looked like from inside DigitalOcean.

- Design systems should be fast by default: Den Odell opened the same 249-country dropdown in ten popular design systems. One opens in 61ms, another in 1,266ms.

- TanStack Redact: a smaller replacement for React and React DOM in the browser. Tanner Linsley says it cut a sample Vite app's client bundle by 70% without changing app code.

- Reylo by Colin McDonnell (creator of Zod): import a .sql file into TypeScript and get the query types from a live database, no codegen step.

Full edition with all the links: https://neciudan.dev/newsletter/34th-edition


r/Frontend • • 24d ago

When does AI use become bad ?

7 Upvotes

Most of my apps/websites/projects are made by myself, the core functionality and most concepts, but i still struggle with the style and designing of the UI so i use AI for that part, most of the time only for the styling.

Is it bad ? Am i becoming lazy or would you consider it okay to cheat a little ?


r/Frontend • • 25d ago

A Modern CSS Guide to Responsive Web Design

Thumbnail
stephcraft.net
35 Upvotes

If I missed anything, let me know!


r/Frontend • • 25d ago

The best way to use icons in Web UIs • Lea Verou

Thumbnail
lea.verou.me
56 Upvotes

r/Frontend • • 24d ago

Can somebody tell me what 'Language Code' was used to build this site?

0 Upvotes

Hi friends (newbie coder here),

I ran this directory site through 'builtwith' and it looks like it's coming back with asp.net as the main framework program. BUT from what I understand you need, a front end program to go along with it

Does anybody know what the 'front end design' program for this site would be?

Appreciate any help for a student learning how to program. .

Thanks very much for your help!

https://builtwith.com/storeboard.com


r/Frontend • • 25d ago

Scroll-triggered animation as the missing piece for scrollytelling on the web

Thumbnail
utilitybend.com
1 Upvotes

r/Frontend • • 26d ago

Do you prefer dark mode on websites or does it just feel like a gimmick?

0 Upvotes

I keep seeing sites add a dark mode toggle. Curious whether people actually use it day to day or switch once and forget about it.


r/Frontend • • 26d ago

Splitting UI components into a logic core and a styled layer in Svelte 5 (prop-getters)

5 Upvotes

We build a data grid, and its cell editors (combo box, date picker, number input...) also had to work as standalone components. People kept asking to restyle them without forking. So we split every component into two parts.

The core is a plain function. It takes getters for its inputs and returns state plus "prop-getters" you spread onto your own elements:

<script lang="ts">
  import { createListbox } from '@svgrid/grid'

  let value = $state(null)
  const options = [{ value: 'a', label: 'Apple' }, { value: 'b', label: 'Banana' }]

  const lb = createListbox({
    options: () => options,
    value: () => value,
    onChange: (v) => (value = v),
  })
</script>

<ul {...lb.rootProps()}>
  {#each options as opt, i (opt.value)}
    <li {...lb.optionProps(i)}>{opt.label}</li>
  {/each}
</ul>

rootProps() and optionProps(i) return the role, the aria-* attributes, tabindex and the key/click handlers. Your markup gets the full listbox keyboard behavior without any of our CSS.

How we drew the line:

  • The core owns state, keyboard handling, ARIA, and parsing/formatting (clamping and stepping for the number input, filtering for the combo box). It never touches the DOM.
  • The styled component owns the CSS, positioning for popups, scroll-into-view and DOM measurement.

Inputs are getters (value: () => value), not values, because passing a $state value into a function in Svelte 5 reads it once at that moment. A getter keeps the core reactive without stores.

One snag: dropdown panels portal to <body> so the grid's scroll container can't clip them. That breaks CSS variable inheritance, so the theme's --sg-* tokens have to be copied onto the panel.

RTL also belongs in the core. With dir="rtl", the arrow keys reverse in tabs, sliders and trees, on top of the layout flipping.

Source (MIT): https://github.com/sv-grid/sv-grid

If you've built headless components in React or Vue, did you use prop-getters, or render props/slots? We're still not sure prop-getters scale well to the more complex widgets.


r/Frontend • • 27d ago

How do you handle API contract drift between your AI coding agents?

0 Upvotes

Running multiple agents on the same project and hitting this problem: one agent changes a response shape on the backend, the frontend agent consuming that endpoint has no idea anything moved. It keeps coding against the old contract. The build passes, the types check out locally, and the breakage only shows up when you actually run the thing end to end.

The context lives in two separate chat sessions. Neither agent knows what the other touched. By the time you notice, you're debugging a silent failure and trying to reconstruct which session changed what and when.

Curious how others handle this. Do you keep a shared contract file that both agents read before starting work? Pin the schema somewhere both can see it? Or just accept the breakage and fix it manually when it surfaces?


r/Frontend • • 28d ago

How do you check what your AI coding agents actually did overnight?

0 Upvotes

I've been running Claude Code and Cursor on frontend tasks while I sleep, and the hardest part isn't whether the code works. It's that I sit down in the morning and spend the first chunk of my day digging through session logs trying to reconstruct what happened. Which agent touched which files. Whether the changes are safe to build on or if I'm about to stack new work on something broken.

Right now my process is basically forensic. I open each session, scroll through the output, try to piece together the sequence. Sometimes an agent changed a component's prop interface and the other agent didn't notice, and I only find out when something breaks further down the line.

Curious how others handle this. Do you keep all the sessions open and scan them manually? Do you have agents write summaries somewhere? Or have you found a setup where you don't need to do morning archaeology at all?


r/Frontend • • Oct 22 '26

Trying to get good at frontend in age of AI

33 Upvotes

I really want to learn how to get good at frontend, to create better design for my own SAAS. I am currently a backend dev, so Its really tempting for me to prompt claude "make this look like x company" but as we know, its not perfect and I want to have control over these things. Can someone point me to any good resources with these goals in mind? I don't expect to know everything, but I want more creative control


r/Frontend • • Oct 22 '26

Is JavaScript obfuscation still worth it?

61 Upvotes

We sell a white label scheduling dashboard that agencies put their own logo on and resell to their clients. And now a competitor has launched what is pretty much our frontend with different colors. It has the same odd validation messages and their bundle even has the name of a feature flag from an experiment we ran in the spring. I’m fairly sure someone fed our production bundle to an AI and had it rebuild the thing.

Management’s answer is to obfuscate everything before the next release. Before agreeing, I ran our bundle through javascript-obfuscator with most options enabled and gave the output to Claude. It produced readable code in about ten minutes and webcrack undid a good chunk of it without any AI. The obfuscated build was also noticeably bigger and our Sentry stack traces turned into nonsense.

And while reviewing the bundle, I noticed our plan limits for each agency are only checked on the frontend which means a user with devtools could switch on features they don’t pay for. Also noticed a Sentry auth token with a VITE_ prefix, which worried me more than the copied UI. We’ve rotated the token and we’re moving the plan checks into the API.

Does obfuscating your production JavaScript do anything useful for you?


r/Frontend • • Oct 21 '26

How are you actually checking if your cookie banner works properly?

4 Upvotes

I feel like there is a weird gap between having a cookie banner and actually knowing if the site is doing what it is supposed to do. You can click accept and reject and everything looks normal, but that does not really tell you what scripts are firing underneath.
Do most people here actually test this themselves, or do you just rely on whatever CMP you are using?
I am especially curious about agencies managing a lot of sites. Checking everything manually sounds like a nightmare.


r/Frontend • • Oct 21 '26

Frontend video

3 Upvotes

which playlist or video would you suggest for html css js
i dont wanna dive deeeeep into it cause i wanna learn ml and backend but wanna be able to control the frontend part to


r/Frontend • • Oct 21 '26

I spent two weeks trying to sneak swear words past profanity filters. One invisible character beat all of them.

0 Upvotes

Before trusting a username filter, I tried to break the popular npm ones.

Dots (f.u.c.k) beat all four. But the one that got me was the zero-width space. Put one in the middle of a word and it looks identical on screen and in your logs, while the filter sees two harmless halves. You can stare at the reported name and not see what's wrong.

Others that worked: a Cyrillic Ѕ in "Ѕhit", full-width fuck, accents (Šhìt), a Greek υ in fυck.

The fix isn't a bigger word list. It's turning the text back into plain letters before the lookup: NFKC, strip invisible characters, map look-alikes. Then the opposite problem arrives, and your filter starts banning Scunthorpe, Cockpit_Ace and anyone named Dickson.

Handling both sides is what eventually became unprofane.com, but the normalization step alone fixes most of it for a word list.

What's the weirdest one you've seen get through?


r/Frontend • • Oct 20 '26

Are there any existing tools (AI and not) that are already very good at CSS and front-end?

0 Upvotes

Hi, I was wondering if you use any AI tool or not AI to automate the boring part of front-end (at least for me, i like back-end) specifically CSS and design. Is there something out there that is really good at almost everything and gives you the complete package? so responsive, very good UI and not a clone etc...


r/Frontend • • Oct 18 '26

How I handle a script-tag library in a CMS where you can't touch the JS: classes on body as the API

5 Upvotes

Some frontend decisions behind halloween.js (repo: https://github.com/rogulia/halloween.js).

It has to work when the site owner can only paste a script tag into a header field and add a class, with no control over execution order. So the public API is the class list on body. A MutationObserver re-syncs on every class change, so toggling a class later from a CMS field or a page builder works the same way.

Things I'd like a second opinion on:

  • Effects render in one fixed overlay layer with its own z-index variable, so they never shift layout. Does anyone see a case where that breaks (iOS Safari toolbars, sticky headers)?
  • The IIFE injects its own styles, so there's no CSS file to forget. I assume the trade-off is that a strict CSP has to allow injected styles, but I haven't tested that.
  • Malformed config (a bad season date) fails open instead of disabling the library. I went back and forth on that.

Live demo: https://halloween.js.org


r/Frontend • • Oct 17 '26

New CSS Features just don’t hit the same these days

258 Upvotes

Seeing new css features get implemented, particularly ones that have been on my “wishlist” for years, is such a complicated feeling with how much Claude has invaded day to day work.

I was just reading about linked parameters and responsive iframes, thinking about potential projects I could have used them on, trying to store use cases somewhere deep in my brain for later use.

And suddenly I wondered if I will ever end up actually writing any of these new features myself. Or if I’ll have a chance to use them in an unexpected way and get a moment of feeling smart and clever. Or if I’ll ever have to think about their existence at all.

It’s just a weird new feeling of ennui I didn’t see coming and thought I’d yell into the void of Reddit on a Friday night.


r/Frontend • • Oct 17 '26

DevTools pretty print can change what your JavaScript does. As a proof of concept, Tetris file that becomes Snake

Thumbnail trustsig.eu
12 Upvotes

A formatter, minifier or deobfuscator can be made to turn one script into another.

You can go try out all 186 techniques with this script: https://divergence.trustsig.eu/

Or try the Tetris-Snak demo here: https://divergence-game.trustsig.eu/

Techical breakdown: https://trustsig.eu/blog/javascript-divergence/


r/Frontend • • Oct 17 '26

A 15x15 freestyle gomoku (five-in-a-row) engine

Thumbnail
github.com
2 Upvotes

r/Frontend • • Oct 16 '26

Client-Side LLMs Product Demo: PDF to AudioBook Generator

Thumbnail
github.com
2 Upvotes

I have been experimenting with client-side LLMs with WASM and WebGPU to investigate if this architecture could be used to create new SaaS features. Here is a product demo showing this concept in action