whoami
Lucas Jenß
cat /etc/motd
The Coding Journal ツ — Notes taken on an epic coding journey. Technical solutions, debugging notes, and practical guides from the trenches of software development.
ls -la ~/languages/
- drwxr-xr-x
- ▶ PHP
- ▶ Ruby
- ▶ Scala
- ▶ C#
- ▶ JavaScript
- ▶ Objective-C
- ▶ Shell Scripting
ls -la ~/toolchain/
- drwxr-xr-x
- ▶ Typo3
- ▶ Akka
- ▶ Capistrano
- ▶ Git
- ▶ MAMP
- ▶ Adobe Illustrator
- ▶ NSTrackingArea (Cocoa)
uname -a
- drwxr-xr-x
- ▶ Mac OS X
- ▶ Unix
Building A Reusable SVG Icon System With Illustrator And CSS
A consistent icon set can save time across a website, product dashboard, or documentation project. Rather than exporting every Illustrator symbol as a separate image, you can create a compact SVG sprite and control its appearance with an external CSS stylesheet. That gives developers a single source for icons while preserving familiar design tooling for illustrators. Learn more about Railsde Jian Dannaburoguenjinwo Zi Zuoshitemita 849486.
The approach suits practical projects where visual details change frequently. A navigation icon may need to work in a dark header, a warning symbol may need several colour states, and a touch target must remain usable on a mobile screen in Sydney or Perth. With sensible naming, clean SVG markup, and a small CSS layer, those variations become manageable instead of repetitive.
Prepare Illustrator Symbols For Export
Start by creating each icon as a symbol in Illustrator. Keep the artwork aligned to a predictable artboard, preferably a square such as 24 × 24 or 32 × 32 units. A shared grid makes icons appear balanced when they sit beside text, even when their shapes contain different amounts of empty space.
Use descriptive symbol names such as menu, search, calendar, and external-link. Avoid spaces, punctuation, and names that describe temporary design decisions. These names may become IDs in the exported SVG, and stable IDs are essential when the icons are referenced with <use>.
Before exporting, convert strokes to outlines only when the stroke geometry must remain exact. Otherwise, a stroke with vector-effect="non-scaling-stroke" can be useful for icons that need to scale without changing line weight. Remove hidden layers, unused swatches, clipping paths, and duplicated artwork. A careful cleanup pass is often more valuable than another round of visual tweaking.
Illustrator’s export options can produce verbose markup, especially when the document has accumulated experimental groups. This is where the notes on removing unused groups are useful: smaller files are easier to inspect, cache, and maintain.
Turn The Artwork Into A Symbol Sprite
A symbol sprite stores reusable drawings inside <symbol> elements. Each symbol receives an ID and a viewBox, but it does not render until another element references it. A simplified sprite might look like this:
<svg xmlns="http://www.w3.org/2000/svg">
<symbol id="search" viewBox="0 0 24 24">
<circle cx="10.5" cy="10.5" r="6.5" fill="none"
stroke="currentColor" stroke-width="2"/>
<path d="m16 16 5 5" fill="none"
stroke="currentColor" stroke-width="2"/>
</symbol>
</svg>
The consuming page can then use the symbol like this:
<svg class="icon icon--search" aria-hidden="true">
<use href="/assets/icons.svg#search"></use>
</svg>
Give the outer SVG a consistent viewBox when you need to set it explicitly, although the symbol’s viewBox is generally inherited by the <use> instance in modern browsers. Add role="img" and an accessible label when the icon communicates information. Decorative icons should be hidden from assistive technology with aria-hidden="true".
Illustrator may export a collection of groups rather than clean symbols. In that case, export the artwork, inspect the resulting XML, and move the reusable paths into hand-authored <symbol> blocks. This small amount of editing creates a more reliable icon library than trying to preserve every Illustrator-generated wrapper.
Connect SVG Shapes To External CSS
The main advantage of CSS control is separating appearance from geometry. Set paths and strokes to currentColor where possible, then control the icon through the parent element:
.icon {
display: inline-block;
width: 1em;
height: 1em;
color: #263238;
fill: currentColor;
vertical-align: -0.125em;
}
.icon--muted {
color: #68747d;
}
.button:hover .icon,
.button:focus-visible .icon {
color: #006b5f;
}
Remove fixed fill and stroke attributes from Illustrator output when they prevent inheritance. A hard-coded black path will ignore the colour assigned to .icon; currentColor lets the icon follow text colour, theme variables, hover states, and high-contrast settings.
There is an important browser distinction. An inline sprite placed in the HTML document is straightforward to style with the page’s external CSS. A sprite loaded as an external file through <use href="/assets/icons.svg#search"> is cacheable and convenient, but styling internal paths from the referencing document can vary by browser and by the way the resource is loaded. In practice, use currentColor, test the target browsers, and avoid relying on deep selectors that cross document boundaries.
If the icon file must carry its own styling, an SVG stylesheet reference can be embedded in the SVG document. That is less convenient for theme switching and may interact with content security policy, so an inline sprite remains the safest choice when detailed CSS control is required.
Choose A Practical Delivery Pattern
Different delivery methods suit different projects. A small marketing site may inline the complete sprite once, while a large application may prefer a cached external file. The right decision depends on how much styling control, caching, and accessibility behaviour the interface needs.
| Delivery method | Main advantage | Main limitation | Suitable use |
|---|---|---|---|
| Inline SVG symbol sprite | Strong CSS and theme control | Adds markup to the HTML | Applications with dynamic themes |
External SVG with <use> |
Reusable and cacheable | Cross-document styling needs testing | Larger sites with stable icon colours |
| Individual SVG files | Simple asset management | Repeats requests and markup | A few occasional icons |
SVG as <img> |
Reliable isolation and caching | Page CSS cannot recolour paths | Brand marks and fixed-colour graphics |
For an Australian site serving users across Melbourne, Brisbane, and regional areas, caching matters because connection quality and latency can vary between locations. A single compressed external sprite may be preferable to many separate requests. Conversely, an inline sprite can avoid a late icon paint when the interface is rendered during a fast interaction.
Use a build step to optimise the final asset. SVGO or a comparable tool can remove metadata, collapse groups, and shorten path data. Keep the Illustrator file as the editable source, but treat the cleaned SVG sprite as a generated web asset. That distinction prevents manual browser-specific edits from being lost in the next export.
Build Naming, States, And Accessibility Rules
A useful naming convention separates the icon’s meaning from its visual state. IDs such as arrow-left, document, and warning describe reusable geometry. CSS classes such as .icon--small, .icon--danger, and .icon--inverse describe context. This prevents duplicate SVG symbols for every colour or size variation.
Recommended rules make the system easier to extend:
- Use stable, lowercase IDs with hyphens.
- Reserve modifiers for size, colour, and interaction state.
- Keep one viewBox convention across the library.
- Document icons that require a visible text label.
For a button labelled “Download”, the icon is decorative and should be hidden. For an icon-only control, provide an accessible name through visible text, aria-label, or a linked <title>. Do not assume a magnifying-glass shape communicates “Search” to every user.
Accessibility also includes contrast and touch sizing. A pale grey icon that looks acceptable on a designer’s calibrated monitor may disappear on a bright outdoor screen in Queensland. Keep the clickable control around 44 × 44 CSS pixels where possible, even if the actual drawing remains 16 or 20 pixels wide.
Test The System In Real Interfaces
Test icons in navigation, forms, cards, alerts, and disabled controls rather than viewing them only on the Illustrator artboard. Check baseline alignment beside Australian English labels such as “Organisation” or “Authorise”, since text length and spelling can affect the available space in a component.
Inspect the generated SVG in browser developer tools. Look for unexpected inline fills, duplicate IDs, enormous decimal values, masks that could be replaced by simpler paths, and invisible rectangles expanding the clickable area. If an icon fails after a deployment, check the asset path, MIME type, cache headers, and whether the server serves SVG with the expected content type.
The surrounding platform can expose unrelated problems too. For desktop macOS work, notes about Cocoa tracking areas provide a useful reminder that pointer behaviour belongs to the interaction layer, not the artwork itself. Keep hover and focus logic in CSS or JavaScript, while the SVG remains a reusable visual component.
Test with keyboard navigation, VoiceOver, browser zoom, dark mode, and forced-colour settings. If the project targets government, education, or enterprise clients in Australia, accessibility expectations are often part of procurement rather than a late optional enhancement. A clear icon system helps meet those requirements consistently across templates.
Maintain A Shared Asset Workflow
Keep the Illustrator source, exported raw SVG, optimised sprite, and CSS component styles in a predictable directory structure. A short README should explain how to add an icon, how IDs are assigned, which attributes are safe to edit, and how the optimisation command runs. This is especially valuable when a project changes hands or when a freelancer contributes a new symbol.
Version the sprite with the rest of the application and review visual changes like code changes. A modified viewBox can shift alignment throughout a design system, while a renamed ID can silently remove an icon from production. Automated checks can verify that required IDs exist and that forbidden inline colours have not returned.
For teams using Rails, PHP, TYPO3, or a static build pipeline, generate the sprite during deployment rather than editing a production copy. A short build process makes the same asset available to local development, staging, and the live site, whether the server is in Sydney or hosted overseas.
Start with a small set of carefully cleaned symbols, connect them to currentColor, and test the chosen delivery method in the browsers your audience uses. Then add the sprite to your component library, document the naming rules, and make the next icon a repeatable build task rather than a one-off export.
cat ~/interests.json
| Key | Value |
|---|---|
| editor | Terminal-first workflow |
| os | Mac OS X / Unix |
| vcs | Git, distributed version control |
| deploy | Capistrano, cron automation |
| graphics | SVG, Adobe Illustrator troubleshooting |
| networking | IP validation, SSH, VPN |
git log --oneline --reverse
Solving SVG import issues in Adobe Illustrator CS6 and CC
When importing an SVG into Illustrator, the operation fails with an unknown error [CANT]. A workaround for this Adobe-side bug.
Solving NDK build issues on OS X
Troubleshooting native development kit compilation problems on Mac OS X.
Programmatically adding PHP generated TypoScript to the backend configuration
Integrating dynamically generated TypoScript into Typo3 backend setups using PHP.
ArgumentError: Could not parse PKey: no start line
Debugging an SSH key parsing error encountered during deployment.
Validating IP-Addresses in PHP
Using PHP filter functions with flags like FILTER_FLAG_IPV4 and FILTER_FLAG_IPV6, and understanding how filter_var handles reserved IP addresses.
Cocoa: Using NSTrackingArea
A short tutorial on using Cocoa's NSTrackingArea to capture mouseEntered and mouseExited events.
cat ~/contact.txt