| name | livecodes/language-support |
| description | Work with 90+ supported languages, compilers, CSS processors, and WASM-compiled languages for markup, style, and script editors. Load this skill when configuring languages, setting up CSS processors, or working with WASM-based languages like Python, Ruby, or Go.
|
| type | core |
| library | livecodes |
| library_version | 0.13.0 |
| sources | ["live-codes/livecodes:docs/docs/languages/index.mdx","live-codes/livecodes:docs/docs/languages/_template.mdx","live-codes/livecodes:docs/docs/features/css.mdx"] |
| references | ["references/languages.md"] |
LiveCodes — Work with Languages
LiveCodes supports 90+ languages across three editors: markup (HTML/templating), style (CSS/preprocessors), and script (JS/compiled languages).
Setup
import { createPlayground } from 'livecodes';
createPlayground('#container', {
config: {
markup: { language: 'markdown', content: '# Hello' },
style: { language: 'scss', content: '$color: blue; body { color: $color; }' },
script: { language: 'typescript', content: 'const x: number = 1;' },
},
});
createPlayground('#container', {
config: {
script: { language: 'python-wasm', content: 'print("Hello from Python")' },
},
});
createPlayground('#container', { template: 'react' });
Core Patterns
Set language for each editor
markup: { language: 'html', content: '...' }
markup: { language: 'markdown', content: '...' }
markup: { language: 'mdx', content: '...' }
markup: { language: 'pug', content: '...' }
markup: { language: 'handlebars', content: '...' }
style: { language: 'css', content: '...' }
style: { language: 'scss', content: '...' }
style: { language: 'less', content: '...' }
style: { language: 'stylus', content: '...' }
: { : , : }
: { : , : }
: { : , : }
: { : , : }
Use CSS processors
const config = {
style: { language: 'css', content: '...' },
processors: [
'tailwindcss',
'autoprefixer',
'postcssPresetEnv',
'cssmodules',
'cssnano',
],
};
Import styles from script
script: {
language: 'javascript',
content: `
import 'tailwindcss/utilities.css';
import './style.css'; // Gets added as a link tag
`,
}
import styles from './style.css';
console.log(styles);
WASM languages (first load is slow)
script: { language: 'python-wasm', content: 'def greet(name): return f"Hello, {name}"' }
script: { language: 'ruby-wasm', content: 'puts "Hello from Ruby"' }
script: { language: 'go-wasm', content: 'package main\n\nfunc main() { println("Hello") }' }
WASM languages download large files on first use (5-20MB). Subsequent runs use cached WASM.
Set editor title and position
script: {
language: 'python-wasm',
content: 'print("Hello")',
title: 'Python',
hideTitle: false,
order: 0,
}
script: {
language: 'javascript',
content: 'export function main() { return helper(); }',
hiddenContent: 'function helper() { return 42; }',
}
Common Mistakes
MEDIUM CSS processors in wrong order
Wrong:
processors: ['purgecss', 'tailwindcss', 'autoprefixer'];
Correct:
processors: ['tailwindcss', 'autoprefixer', 'purgecss'];
Processors run in the order listed. Tailwind must generate classes before other processors. In the app UI, processors are ordered automatically.
Source: docs/docs/features/css.mdx — CSS Processors section
MEDIUM WASM language first load appears slow
Wrong assumption:
script: { language: 'python-wasm', content: 'print("Hello")' }
Understanding:
Source: docs/docs/languages/python-wasm.mdx
Language Categories
| Editor | Categories | Examples |
|---|
| Markup | HTML, Markdown, Templates, Diagrams | html, markdown, pug, handlebars, mdx, astro |
| Style | CSS, Preprocessors, PostCSS | css, scss, less, stylus, postcss |
| Script | JS, TypeScript, Compiled, WASM | javascript, typescript, python, ruby, go, php |
Processor Reference
See Full Language Reference for all 90+ languages, aliases, and extensions.
| Processor | Purpose |
|---|
tailwindcss | Utility-first CSS framework |
windicss | Windi CSS (alternative to Tailwind) |
unocss | Atomic CSS engine |
autoprefixer | Add vendor prefixes |
postcssPresetEnv | Use future CSS features |
cssmodules | Scoped CSS classes |
cssnano | Minify CSS |
lightningcss | Fast CSS processing |
tokencss | Design tokens |