Configurable, smart and fast CSS/SCSS/Sass/Less formatter.

Related tags

Command-line malva
Overview

🌷 Malva

Malva is a configurable, smart and fast CSS/SCSS/Sass/Less formatter.

Why?

Configurable

Malva is configurable. It provides several configuration options so you can control the code style as you want.

Given the example below:

button.disabled, button:disabled {}

This selector is short enough to be put on single line, so Malva will put it on a single line by default, instead of forcing it to be splitted into multiple lines.

However, if you prefer putting into multiple lines, you can configure it.

Smart

Given the example below:

button.disabled/*please use pseudo class as possible*/,button:disabled {}

There're comments inside selector. Some formatters will fail to format it, but Malva will format as:

button.disabled /*please use pseudo class as possible*/, button:disabled {}

Try this on playground.

Also, thanks to the Raffia parser, Malva supports cutting edge CSS syntaxes like @container.

Support (indented) Sass

Malva supports indentation-based Sass, not just SCSS.

Quick Start

Try It Online

If you just want a quick try, you can try with the online playground.

dprint

We've provided dprint integration.

Run the command below to add plugin:

dprint config add g-plane/malva

After adding the dprint plugin, update your dprint.json and add configuration:

{
  // ...
  "plugins": [
    "https://plugins.dprint.dev/g-plane/malva-v0.1.2.wasm"
  ],
  "malva": {
    // Malva config comes here
  }
}

You can also read dprint CLI documentation for using dprint to format files.

Standalone CLI

Currently we don't provide standalone CLI. Leave a comment in Discussion and let us know if you need it.

Configuration

Please refer to Configuration.

FAQ

I don't like some of code styles. Can I propose to change it?

Malva is not opinionated and is configurable, and we accept different code styles then switch them with configuration. But before proposing a code style change, it's better to open a new issue or discussion.

My CSS code is in HTML/Vue/Svelte files. How can I format them?

If you're using dprint, you can use markup_fmt which provides a dprint plugin, then you can use these two plugins together.

Credit

Tests come from Prettier.

License

MIT License

Copyright (c) 2023-present Pig Fang

You might also like...
Simple OpenAI CLI wrapper written in Rust, feat. configurable prompts and models

Quick Start git clone https://github.com/ryantinder/ask-rs cd ask cargo install --path . Example ask tell me about the Lockheed Martin SR71 The Loc

Create, reorder, group, and focus workspaces easily in i3. Fully configurable with enhanced polybar modules.
Create, reorder, group, and focus workspaces easily in i3. Fully configurable with enhanced polybar modules.

Create, reorder, group, and focus workspaces fast and easily in i3. Features Focus Mode: Eliminate Distractions Enable Focus Mode: Use groups and focu

Configurable, extensible, interactive line reader

linefeed linefeed is a configurable, concurrent, extensible, interactive input reader for Unix terminals and Windows console. API Documentation linefe

Easy configurable tmux display-menu
Easy configurable tmux display-menu

tmux-easy-menu Easy configurable tmux display-menu Setup cargo build And run with ./target/debug/tmux-menu show --menu {path-to-your-config} Configu

⚡️(cd with env) Is a configurable cd wrapper that lets you define your environment per directory.
⚡️(cd with env) Is a configurable cd wrapper that lets you define your environment per directory.

⚡️cdwe (cd with env) A simple configurable cd wrapper that provides powerful utilities for customizing your envionment per directory. (For ZSH / BASH

Calc: A fully-featured minimalistic configurable calculator written in Rust
Calc: A fully-featured minimalistic configurable calculator written in Rust

Calc Calc: A fully-featured minimalistic configurable rust calculator Install You can install the latest version from source git clone https://github.

A cute and smart arm warmer sleeve ^_^
A cute and smart arm warmer sleeve ^_^

LuLuu! A cute and smart arm-warmer sleeve with a 1.3" full color TFT display built into the back of the hand ^_^ Hardware Runs on a RaspberryPi RP2040

Command line utility for controlling LIFX smart lights

lifxc is a command line utility for controlling LIFX smart lights. Currently, communication over the LIFX LAN protocol is supported.

CLI for the Goki Smart Wallet system.

goki-cli CLI for the Goki Smart Wallet system. Installation First, make sure you have the Solana CLI tools installed. Follow the instructions here. Ne

Releases(v0.1.2)
Owner
Pig Fang
Error messages should be human-friendly.
Pig Fang
Configurable HTML/Vue/Svelte/Jinja/Twig formatter, with dprint integration.

markup_fmt markup_fmt is a configurable HTML/Vue/Svelte/Jinja/Twig formatter. Notes for Vue and Svelte Users This formatter provides some options such

Pig Fang 17 Nov 15, 2023
A formatter for the leptos view! macro

leptosfmt A formatter for the leptos view! macro All notable changes are documented in: CHANGELOG.md Install cargo install leptosfmt or for trying out

Bram 13 Apr 4, 2023
Explain semver requirements by converting them into less than, greater than, and/or equal to form.

semver-explain Convert SemVer requirements to their most-obvious equivalents. semver-explain is a CLI tool to explain Semantic Versioning requirements

Andrew Lilley Brinker 27 Oct 29, 2022
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022
Tools - The Rome Toolchain. A linter, compiler, bundler, and more for JavaScript, TypeScript, HTML, Markdown, and CSS.

Rome is currently being rewritten in Rust. Read more about it in our latest blog post. The documentation below is out of date and available for poster

Rome 22k Jan 3, 2023
⏳ trackie is a private, daemon-less time tracker for your CLI.

⏳ trackie `trackie` is a private, daemon-less time tracker running in your CLI. Trackie offers an easy CLI to track the time you spent on your various

Christoph Loy 40 Dec 14, 2022
A minimal browser with a super simple rendering engine for HTML and CSS, using Rust.

minimal-browser A minimal browser with a super simple rendering engine for HTML and CSS, using Rust. Credit: https://github.com/mbrubeck and https://l

Federico Baldini 3 Jan 15, 2023
Uses the cardano mini-protocols to receive every block and transaction, and save them to a configurable destination

cardano-slurp Connects to one or more cardano-node's, streams all available transactions, and saves them to disk (or to S3) in raw cbor format. Usage

Pi Lanningham 16 Jan 31, 2023
excss is a small, simple, zero-runtime CSS-in-JS library with just two APIs.

excss excss is a small, simple, zero-runtime CSS-in-JS library with just two APIs.

Taishi Naritomi 12 Sep 12, 2023
Monorepo for dprint—a pluggable and configurable code formatting platform

dprint Monorepo for dprint—a pluggable and configurable code formatting platform. This project is under active early development. I recommend you chec

null 1.7k Jan 8, 2023