
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@casoon/ui-lib
Advanced tools
Modular, lightweight CSS framework and design system for modern web projects. Optimized for Astro JS, LightningCSS and Container Queries with @layer-based architecture and comprehensive accessibility.
A modular, lightweight CSS framework and design system for modern web projects. While it is especially optimized for use with Astro JS, it is fully framework-agnostic and can be used in any web project. The library is developed by an author who primarily uses Astro JS, but it is not limited to that ecosystem. It is also optimized for LightningCSS and Container Queries, featuring a @layer-based architecture and comprehensive accessibility.
.motion-safe/.motion-reduce for prefers-reduced-motionnpm install @casoon/ui-lib
# or
yarn add @casoon/ui-lib
# or
pnpm add @casoon/ui-lib
This option is ideal for developers using Lightning CSS who need:
Basic:
<link rel="stylesheet" href="path/to/@casoon/ui-lib/index.css">
With Bundler:
import '@casoon/ui-lib/index.css';
With Astro:
import '@casoon/ui-lib/index.css';
This option provides a pre-bundled and optimized version for:
Direct HTML:
<link rel="stylesheet" href="path/to/@casoon/ui-lib/dist/index.min.css">
With Bundler:
import '@casoon/ui-lib/dist/index.min.css';
With Astro:
import '@casoon/ui-lib/dist/index.min.css';
Via unpkg.com CDN:
<link rel="stylesheet" href="https://unpkg.com/@casoon/ui-lib/dist/index.min.css">
Note about the unpkg.com version: The minified version contains basic functionality but may not include all effects and components. For specific components or effects, these can be loaded selectively:
<!-- Base CSS -->
<link rel="stylesheet" href="https://unpkg.com/@casoon/ui-lib/dist/index.min.css">
<!-- Additional components as needed -->
<link rel="stylesheet" href="https://unpkg.com/@casoon/ui-lib/effects/visual/shadows.css">
<link rel="stylesheet" href="https://unpkg.com/@casoon/ui-lib/ui/components/card.css">
interpolate-size: allow-keywords for smooth transitions and typography@casoon/ui-lib/
├── index.css # Main file with layer imports
├── dist/ # Contains bundled versions
│ ├── index.min.css # Minified bundle with all imports resolved
│ ├── index.min.css.map # Source map for debugging
│ ├── index.bundled.css # Non-minified bundle for development
│ ├── components.min.css # Minified bundle of UI components
│ ├── effects.min.css # Minified bundle of effects
│ ├── icons.min.css # Minified bundle of icons
│ └── themes.min.css # Minified bundle of themes
├── core/ # Core styles and reset
│ ├── reset.css # CSS reset
│ ├── colors.css # Base colors
│ ├── color-mix.css # Color mixing utilities
│ ├── logical-properties.css # Logical properties
│ ├── smooth-scroll.css # Smooth scrolling
│ └── accessibility/ # Accessibility helpers
│ ├── aria.css # ARIA utilities
│ ├── contrast.css # Color contrast
│ ├── keyboard.css # Keyboard navigation
│ └── screenreader.css # Screen reader utilities
├── layout/ # Layout system
│ ├── index.css # Layout imports
│ ├── responsive.css # Responsive breakpoints
│ ├── spacing.css # Spacing utilities
│ ├── flex-layouts.css # Flexbox utilities
│ ├── grid-system.css # Grid utilities
│ └── containers/ # Container system
│ ├── index.css # Container imports
│ ├── base.css # Basic container components
│ ├── position.css # Positioned containers with z-index
│ ├── responsive-containers.css # Responsive containers
│ ├── special.css # Special containers (scrollable, masonry)
│ ├── asymmetric.css # Split layouts and aspect ratio containers
│ ├── visual.css # Visual styling containers
│ ├── functional.css # Functional UI containers
│ ├── performance.css # Performance-optimized containers
│ └── a11y.css # Accessibility-optimized containers
├── tokens/ # Design tokens
│ ├── index.css # Token imports
│ ├── colors/ # Color tokens
│ ├── spacing/ # Spacing tokens
│ ├── typography/ # Typography tokens
│ └── effects/ # Effect tokens
├── typography/ # Typography system
│ ├── index.css # Typography imports
│ ├── typography.css # Typography styles
│ ├── hierarchy/ # Heading hierarchy
│ ├── baseline/ # Baseline grid
│ └── weights/ # Font weights
├── utilities/ # Utility classes
│ ├── index.css # Utility imports
│ ├── helpers/ # Helper utilities
│ ├── mixins/ # CSS mixins
│ ├── variables/ # CSS variables
│ └── customize/ # Customization utilities
├── themes/ # Theming system
│ ├── index.css # Theme imports
│ ├── base/ # Base theme
│ ├── mode/ # Light/dark modes
│ └── variants/ # Theme variants
├── icons/ # Icon system
│ ├── index.css # Icon imports
│ ├── base.css # Icon base styles
│ └── [icon-sets]/ # Various icon sets
├── fonts/ # Web fonts
│ ├── fonts.css # Main CSS file with all variables and utility classes
│ ├── README.md # Documentation
│ └── [font-name]/ # Directory for each font
│ ├── 400.css # CSS for regular weight
│ ├── 700.css # CSS for bold weight
│ ├── index.css # Imports all weights
│ └── *.woff2 # WOFF2 files
├── ui/ # UI components
│ ├── index.css # UI imports
│ ├── elements.css # Elements collection
│ ├── components.css # Components collection
│ ├── elements/ # Basic UI elements
│ ├── components/ # Complex UI components
│ ├── layout/ # Layout components
│ └── patterns/ # UI patterns
├── effects/ # Effects & interactions
│ ├── interaction/ # Interaction effects
│ ├── layout-effects/ # Layout effects
│ ├── motion/ # Motion effects
│ ├── particles/ # Particle effects
│ ├── themes/ # Theme effects
│ ├── typography/ # Typography effects
│ └── visual/ # Visual effects
└── js/ # JavaScript helpers
├── theme-switcher.js # Theme switching logic
└── viewTransitions.js # View transition helpers
Layer hierarchy (excerpt):
@layer reset, tokens, custom-properties, core, logical-properties, colors, color-mix, layout, layout-queries, typography, utilities, smooth-scroll, accessibility, icons, components, animations, effects, themes;
See the Layer System Documentation for more details.
The library includes a collection of optimized Google Fonts in WOFF2 format for better performance and privacy. Using self-hosted fonts eliminates external requests to Google's servers and reduces load times.
The fonts are organized in an improved structure:
/fonts/
├── fonts.css # Main CSS file with all variables and utility classes
├── README.md # Documentation
│
├── roboto/ # Each font has its own directory
│ ├── 400.css # CSS for regular weight
│ ├── 700.css # CSS for bold weight
│ ├── index.css # Imports all weights
│ ├── roboto-regular.woff2 # WOFF2 file for regular weight
│ └── roboto-bold.woff2 # WOFF2 file for bold weight
You can include the fonts in different ways:
/* Only the CSS variables and utility classes, without the fonts themselves */
@import '@casoon/ui-lib/fonts/fonts.css';
/* A specific font with all weights */
@import '@casoon/ui-lib/fonts/roboto/index.css';
/* Only a specific weight of a font */
@import '@casoon/ui-lib/fonts/roboto/400.css';
For Astro projects, you can simply import the CSS files as shown above. Vite (used by Astro) or Webpack will automatically analyze the CSS and include the font files in your project's build without requiring any plugins or manual copying. For more information, see the Fonts README.
The library includes the following Google Fonts:
<div class="container-query">
<div class="layout-flex sm:flex-row md:gap-6 lg:flex-nowrap">
<div class="sm:flex-basis-1-3">Sidebar</div>
<div class="sm:flex-basis-2-3">Main content</div>
</div>
</div>
The library provides a comprehensive container layout system with various specialized container types:
<!-- Standard container with centered content and responsive padding -->
<div class="container">Content</div>
<!-- Container with specific size constraint -->
<div class="container container-md">Medium width container</div>
<!-- Container with custom padding -->
<div class="container container-padding-lg">Container with large padding</div>
<!-- Sticky containers -->
<div class="container-sticky-top">Sticks to the top</div>
<!-- Fixed containers -->
<div class="container-fixed-bottom">Fixed to the bottom</div>
<!-- Absolute containers -->
<div class="container-absolute-center">Centered absolutely</div>
<!-- Scrollable container -->
<div class="container-scrollable-md">
Content with controlled height and scrolling
</div>
<!-- Masonry layout -->
<div class="container-masonry-3">
<div class="masonry-item">Item 1</div>
<div class="masonry-item">Item 2</div>
</div>
You can add your own components in the components layer:
@layer components {
.my-component {
padding: var(--space-4);
color: var(--color-primary);
border-radius: var(--radius-md);
}
}
The library employs progressive enhancement and fallback strategies to ensure wide browser compatibility:
@supports rules instead of browser detectionFor detailed compatibility information, browser support charts, and implemented fallback strategies, see the Documentation.
npm run test:lightningcss
The library includes a browser compatibility testing suite that covers:
The tests are designed to ensure compatibility across:
To run the tests:
# Start a local server
npx serve
# Access the test suite
# http://localhost:3000/tests/browser-compatibility/
The test files include:
viewport-units-test.html - Tests for viewport unit implementationtheme-system-test.html - Tests for theme switching and persistenceaccessibility-test.html - Tests for accessibility featuresThe test suite provides browser information and documents compatibility issues in compatibility-issues.md, helping developers identify and address browser-specific challenges when using the library.
Additional tests for container queries and related layout features are available in the tests/container-compatibility directory.
The library comes with comprehensive documentation to help you get started:
MIT
Contributions welcome! See Contribution Guidelines.
FAQs
Modular, lightweight CSS framework and design system for modern web projects. Optimized for Astro JS, LightningCSS and Container Queries with @layer-based architecture and comprehensive accessibility.
We found that @casoon/ui-lib demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.