Skip to content

Stylus error example: Descendant selector by wykopchanger

Screenshot of Stylus error example: Descendant selector

Details

Authorwykopchanger

LicenseNo License

Categorygoogle.com

Created

Updated

Size1.6 kB

Statistics

Learn how we calculate statistics in the FAQ.

Failed to fetch stats.

Description

Notes

Userstyle doesn't have notes.

Source code

/* ==UserStyle==
@name           Descendant selector AND general sibling selector with curly bracket in new line causes error
@version        1

@preprocessor   stylus
@namespace      userstyles.world/user/test2
@license        No License (YOU CAN USE THIS CODE ONLY IN STYLUS EXTENSIONS. You are not allowed to: copy any part of the code, share, and use it anywhere)
==/UserStyle== */   
@-moz-document url-prefix("https://google.com")
{
    // descendant selector with opening curly bracket in new line
    // THIS PRODUCES AN ERROR "Cannot read properties of undefined (reading 'block')"

/*
    div small
    {
        font-size: 0.7em;
    }
*/


    // general sibling selector with curly bracket in new line
    // THIS PRODUCES AN ERROR "Cannot read properties of undefined (reading 'block')"

/*    
    div ~ small
    {
        font-size: 0.7em;
    }
*/


    // child selector DOES NOT PRODUCE AN ERROR
    div > small
    {
        font-size: 0.7em;
    }
    // adjacent sibling selector DOES NOT PRODUCE AN ERROR
    div + small
    {
        font-size: 0.7em;
    }
    
    // element selector DOES NOT PRODUCE AN ERROR
    div
    {
        font-size: 0.7em;
    }
    
    // descendant selector with opening curly bracket in the same line
    // DOES NOT PRODUCE AN ERROR
    div small {
        font-size: 0.7em;
    }
    
    // general sibling selector with opening curly bracket in the same line
    // DOES NOT PRODUCE AN ERROR
    div ~ small {
        font-size: 0.7em;
    }
    




}

Reviews

No reviews yet.