KC's Workspace
    Preparing search index...

    Source represents an interface for the Node.source property.

    interface Source {
        end?: Node.Position;
        input: Input_;
        start?: Node.Position;
    }
    Index

    Properties

    Properties

    The inclusive ending position for the source code of a node.

    However, end.offset of a non Root node is the exclusive position. See https://github.com/postcss/postcss/pull/1879 for details.

    const root = postcss.parse('a { color: black }')
    const a = root.first
    const color = a.first

    // The offset of `Root` node is the inclusive position
    css.source.end // { line: 1, column: 19, offset: 18 }

    // The offset of non `Root` node is the exclusive position
    a.source.end // { line: 1, column: 18, offset: 18 }
    color.source.end // { line: 1, column: 16, offset: 16 }
    input: Input_

    The source file from where a node has originated.

    start?: Node.Position

    The inclusive starting position for the source code of a node.