Skip to content

Feature request: Add @match directive support #2002

@bezustally

Description

@bezustally

Overview

I would like to add support for the @match directive in usercss files, similar to other CSS preprocessors.

Use Case

Currently users can only use @url, @urlprefix, @domain, and @regexp directives for targeting. The @match directive would provide a more flexible way to specify URL patterns.

Proposed Implementation

  • Add @match directive parser in meta-parser.js
  • Update style matcher to handle @match patterns
  • Enhance usercss compiler for @match compatibility
  • Update UI to display @match patterns with favicons

Example Usage

@match https://example.com/*
@match https://*.github.com/*

body {
  background: red;
}

Benefits

  • Better style targeting precision
  • Enhanced compatibility with other CSS preprocessors
  • Improved user experience with visual domain indicators

Would this feature be welcome in the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions