Skip to content

Autocomplete shown for addUtilities but not for addComponents #67

@drecdroid

Description

@drecdroid

For example:

function stackComponent({ addUtilities, theme }) {
    const spacing = theme('spacing')
    const stack = {};
    ['', '-sm', '-md'].forEach((size, i) => {
        let cls = `.stack${size}`
        stack[cls] = {
            width: '100%',

            '& > *': {
                marginBottom: spacing[(i+1)*2]
            },
            '& > *:last-child': {
                marginBottom: '0'
            }
        }
    })

    addUtilities(stack)
}

Will show "stack", "stack-sm", "stack-md" in the autocompleter when added as plugin using addUtilities function but won't be shown if added with addComponents function. Both ways correctly adds the rules to the resulting css.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions