source/index.js
function split_into_style_lines_and_children_lines(lines)
{
	// get this node style lines
	const style_lines = lines.filter(function(line)
	{
		// styles always have indentation of 1
		if (line.tabs !== 1)
		{
			return false
		}

		// detect generic css style line (skip modifier classes and media queries)
		const colon_index = line.line.indexOf(':')

		// is not a modifier class
		return !starts_with(line.line, '&') 
			// is not a media query style class name declaration
			&& !starts_with(line.line, '@media') 
			// is not a keyframes style class name declaration
			&& !starts_with(line.line, '@keyframes') 
			// has a colon
			&& colon_index >= 0 
			// is not a state class (e.g. :hover) name declaration
			&& colon_index !== 0
			// is not a yaml-style class name declaration
			&& colon_index < line.line.length - 1
	})

	// get children nodes' lines
	const children_lines = lines.filter(line => style_lines.indexOf(line) < 0)

	// reduce tabulation for this child node's (or these child nodes') child nodes' lines
	children_lines.forEach(line => line.tabs--)

	return { style_lines, children_lines}
}
function split_into_style_lines_and_children_lines(lines)
{
	// get this node style lines
	const style_lines = lines.filter(function(line)
	{
		// styles always have indentation of 1
		if (line.tabs !== 1)
		{
			return false
		}

		// detect generic css style line (skip modifier classes and media queries)
		const colon_index = line.line.indexOf(':')

		// is not a modifier class
		return !starts_with(line.line, '&') 
			// is not a media query style class name declaration
			&& !starts_with(line.line, '@media') 
			// is not a keyframes style class name declaration
			&& !starts_with(line.line, '@keyframes') 
			// has a colon
			&& colon_index >= 0 
			// is not a state class (e.g. :hover) name declaration
			&& colon_index !== 0
			// is not a yaml-style class name declaration
			&& colon_index < line.line.length - 1
	})

	// get children nodes' lines
	const children_lines = lines.filter(line => style_lines.indexOf(line) < 0)

	// reduce tabulation for this child node's (or these child nodes') child nodes' lines
	children_lines.forEach(line => line.tabs--)

	return { style_lines, children_lines}
}
function split_into_style_lines_and_children_lines ( lines ) { // get this node style lines const style_lines = lines . filter ( function ( line ) { // styles always have indentation of 1 if ( line . tabs !== 1 ) { return false } // detect generic css style line (skip modifier classes and media queries) const colon_index = line . line . indexOf ( ':' ) // is not a modifier class return ! starts_with ( line . line , '&' ) // is not a media query style class name declaration && ! starts_with ( line . line , '@media' ) // is not a keyframes style class name declaration && ! starts_with ( line . line , '@keyframes' ) // has a colon && colon_index >= 0 // is not a state class (e.g. :hover) name declaration && colon_index !== 0 // is not a yaml-style class name declaration && colon_index < line . line . length - 1 } ) // get children nodes' lines const children_lines = lines . filter ( line => style_lines . indexOf ( line ) < 0 ) // reduce tabulation for this child node's (or these child nodes') child nodes' lines children_lines . forEach ( line => line . tabs -- ) return { style_lines , children_lines } }
separates style lines from children lines
separates style lines from children lines