
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@unocss/inspector
Advanced tools
@unocss/inspector is a tool designed to help developers inspect and debug their UnoCSS styles directly within their development environment. It provides a visual interface to see which styles are applied to elements, making it easier to understand and troubleshoot CSS issues.
Style Inspection
This feature allows developers to inspect the styles applied to elements in their application. By attaching the inspector, you can hover over elements to see the UnoCSS classes and styles applied to them.
import { createInspector } from '@unocss/inspector';
const inspector = createInspector();
inspector.attach();
Live Editing
Live editing allows developers to make changes to their UnoCSS styles directly from the inspector interface. This can speed up the development process by providing immediate feedback on style changes.
import { createInspector } from '@unocss/inspector';
const inspector = createInspector();
inspector.attach();
// Enable live editing
inspector.enableLiveEditing();
Style Source Mapping
Source mapping helps developers trace back the styles to their original source files. This is particularly useful for debugging and understanding where specific styles are coming from.
import { createInspector } from '@unocss/inspector';
const inspector = createInspector();
inspector.attach();
// Enable source mapping
inspector.enableSourceMapping();
Stylelint is a powerful tool for linting CSS and other stylesheets. It helps developers enforce consistent conventions and avoid errors in their styles. Unlike @unocss/inspector, which focuses on inspection and live editing, Stylelint is more about enforcing coding standards and catching errors.
PostCSS is a tool for transforming CSS with JavaScript plugins. It can be used to lint, transform, and optimize styles. While PostCSS is more about processing and transforming CSS, @unocss/inspector focuses on inspecting and debugging styles in a live environment.
cssnano is a CSS optimizer that helps reduce the size of your CSS files. It is used to minify and compress CSS, making it more efficient for production. Unlike @unocss/inspector, which is a development tool, cssnano is used primarily for optimizing CSS for deployment.
The inspector UI for UnoCSS. Ships with unocss
and @unocss/vite
.
Visit http://localhost:3000/__unocss
in your Vite dev server to see the inspector.
splitpanes
, refer to playground)🙌 Contribution welcome!
MIT License © 2021-PRESENT Anthony Fu
FAQs
The inspector UI for UnoCSS
The npm package @unocss/inspector receives a total of 131,978 weekly downloads. As such, @unocss/inspector popularity was classified as popular.
We found that @unocss/inspector demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.