Draft
Add unocss-preset-mgplus: UnoCSS preset for the mgplus mini CSS library#1
Conversation
…nd tests Agent-Logs-Url: https://github.com/mgpluscss/unocss-preset-mgplus/sessions/222bf73b-6b42-4296-a850-dac39c146414 Co-authored-by: medevod <4396827+medevod@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add new mgpluss preset for Uno CSS
Add unocss-preset-mgplus: UnoCSS preset for the mgplus mini CSS library
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces
unocss-preset-mgplus, a UnoCSS preset that brings mgplus styles into UnoCSS workflows — eliminating the need for a separate CSS import while enabling tree-shaking on utility classes.Package setup
package.json/tsconfig.json/tsup.config.ts— TypeScript library project with dual ESM+CJS output and type declarations;unocssas peer dependencytest/preset.test.ts— 44 vitest tests covering all rule categories and preflight optionsPreset implementation (
src/)index.ts— exportspresetMgplus(options?)acceptingcomponents,utilities, anddarkModeflagstypes.ts—PresetMgplusOptionsandComponentNameunion typepreflights.ts— injects CSS custom properties (:root { --mg-* }) and full component styles (button, badge, alert, nav, modal, grid, tabs, check, toggle, dropdown, loader, progress, group, icon, timeline, dark mode) as UnoCSS preflights; component inclusion is configurablerules.ts— tree-shakeable UnoCSS rules for all utility classes: spacing (mg-pad*,mg-marg*), sizing (mg-w*,mg-h*,mg-min-*,mg-max-*), display, overflow, visibility, border/radius, positioning, z-index, text, and color utilities (mg-{color},mg-bg-{color},mg-border-{color})Usage
Component styles with pseudo-classes/nested selectors are injected via preflights (no tree-shaking); utility classes are defined as UnoCSS rules and are tree-shaken at build time.