Skip to content

v1.1.0 - Enhanced CSS Unit Converter

Latest

Choose a tag to compare

@atiladefreitas atiladefreitas released this 05 Dec 23:48

🎯 TinyUnit v1.1.0 - Enhanced CSS Unit Converter

What's Changed

TinyUnit introduces significant improvements to em unit handling and better user experience:

  • Added separate parent font size support for accurate em calculations
  • Introduced :TinyUnitParent command for dynamic parent font size adjustments
  • Enhanced UI with parent font size display in converter window
  • Improved keymap discoverability with descriptive messages
  • Fixed em calculations to properly reflect CSS specifications

Technical Details

New Features

  • Parent font size configuration independent from root font size
  • Real-time parent font size updates through command interface
  • Accurate distinction between rem (root-relative) and em (parent-relative) calculations

Configuration Updates

{
    font = {
        base_size = 16,     -- Root font size for rem calculations
        parent_size = 14    -- Parent font size for em calculations (optional)
    }
}

Commands

  • :TinyUnitParent <size> - Set parent element font size for em calculations
    Example: :TinyUnitParent 12 sets parent font size to 12px

Installation

Using Lazy.nvim:

{
    "atiladefreitas/tinyunit",
    version = "v1.1.0",
    config = function()
        require("tinyunit").setup({
            font = {
                base_size = 16,    -- Optional: customize root font size
                parent_size = 14   -- Optional: set different parent font size
            }
        })
    end
}

Migrating From v1.0.0

The update is fully backward compatible. No migration steps are required.

  • Existing configurations will continue to work
  • Parent font size defaults to base font size if not specified
  • New font configuration options can be added as needed

Bug Fixes

  • Fixed em calculations to correctly use parent font size instead of root font size
  • Improved unit conversion accuracy for relative units

Acknowledgments

Thanks to the community for valuable feedback on em unit handling and CSS specifications.