A simple, browser-based tool for merging CSS files while intelligently handling overlapping styles and removing duplicates.
- Merge new CSS into existing CSS, with new styles taking precedence
- Automatically combine selectors with the same name
- Remove duplicate and overlapping CSS properties
- Client-side processing (no server required)
- Saves your work using localStorage
- Clean, minimal interface
CSS Merger parses your CSS files into structured objects and then intelligently merges them following these rules:
- All selectors from both files are preserved
- When the same selector exists in both files, all properties are kept with new CSS taking precedence
- Duplicate properties within selectors are eliminated
- The output is formatted with consistent spacing and indentation
- Paste your old/existing CSS in the first textarea
- Paste your new CSS in the second textarea
- Click "Merge CSS"
- Copy the merged result from the output box
Your inputs and the result are automatically saved to localStorage, so you won't lose your work if you refresh the page.
The CSS merger works by:
- Parsing CSS into JavaScript objects where each selector contains a map of properties
- Deep-cloning the old CSS object as the base
- Iterating through the new CSS object and applying its properties on top of the old ones
- Converting the merged object back to properly formatted CSS text
- Does not currently support complex CSS features like:
- Media queries
- CSS animations/keyframes
- CSS variables
- Nested selectors (as in SCSS)
- Comments are stripped during processing
Works in all modern browsers with JavaScript enabled.
MIT