π¨ Mew - A lightweight CSS preprocessor with elegant BEM support
A modern CSS preprocessor crafted in Rust, featuring intuitive nesting, variables, and seamless BEM integration. Write cleaner, more maintainable CSS with a minimalist yet powerful syntax.
- π― BEM Support: Write cleaner CSS with automatic BEM class generation
- π Nested Rules: Simplified syntax for nested selectors
- π¦ Variables: Basic variable support for reusable values
- π Directory Processing: Process single files or entire directories
- π¨ Clean Output: Generate well-formatted CSS output
The easiest way to install Mew is through npm:
npm install -g @antharuu/mew
Alternatively, you can build from source:
# Clone the repository
git clone https://github.com/antharuu/Mew.git
cd Mew
# Build the project
cargo build --release
# The binary will be available in target/release/mew
Optional: Add to your PATH for system-wide access:
# Linux/macOS
echo 'export PATH="$PATH:/path/to/mew/target/release"' >> ~/.bashrc
source ~/.bashrc
# Windows - Add the release directory to your system's PATH environment variable
Process a single file:
mew input.mew
Process a directory:
mew ./styles
$variable-name: value;
button {
property: $variable-name;
}
// You can omit the dot (recommended)
card {
/* Becomes .card */
&header {
/* Becomes .card__header */
}
@primary {
/* Becomes .card--primary */
}
}
// Or use it explicitly if needed
.block {
/* Also valid, becomes .block */
}
button {
&:hover {
/* Becomes .button:hover */
}
}
$nav-bg: #ffffff;
$nav-spacing: 16px;
// No dot needed
nav {
background: $nav-bg;
padding: $nav-spacing;
&list {
display: flex;
margin: 0;
padding: 0;
}
&item {
list-style: none;
padding: $nav-spacing;
&:hover {
background: #f5f5f5;
}
}
@mobile {
padding: $nav-spacing;
}
}
.nav {
background: #ffffff;
padding: 16px;
}
.nav__list {
display: flex;
margin: 0;
padding: 0;
}
.nav__item {
list-style: none;
padding: 16px;
}
.nav__item:hover {
background: #f5f5f5;
}
.nav--mobile {
padding: 16px;
}
- No advanced functions (like darken, lighten, mix, etc.)
- No mathematical operations beyond basic calculations
- No import/include functionality
- No mixins or extends
- No color manipulation
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a new branch (
git checkout -b feature/improvement
) - Make your changes
- Run the tests (
cargo test
) - Commit your changes (
git commit -am 'Add new feature'
) - Push to the branch (
git push origin feature/improvement
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Made with β€οΈ by Antharuu