WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 2 weeks ago

#52176 closed defect (bug) (fixed)

Twenty Twenty-One: style.css has errors in PhpStorm IDE

Reported by: mukesh27 Owned by: SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: Bundled Theme Keywords: has-patch
Focuses: css, coding-standards Cc:

Description

Hi, just upgraded to WP 5.6 with TwentyTwentyOne theme. The application itself seems to work fine. But when I open it with my PhpStorm IDE, the style.css file shows many errors. Most are related to many -- variables are not defined. But below caught my attention the most:

@media only screen and (min-width: 482px) {

	.primary-navigation > div > .menu-wrapper li {
		margin: 0;
		width: inherit;
	}

	.primary-navigation > div > .menu-wrapper li:last-child() {
		margin-right: 0;
	}
}

The IDE highlight last-child() as error. Why do we need a parenthesis here?

Original support ticket - https://wordpress.org/support/topic/twentytwentyone-theme-style-css-has-errors/

Props to @activecoder

Attachments (1)

52176.diff (675 bytes) - added by munyagu 3 weeks ago.

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
3 weeks ago

Yeah, it looks like the brackets are not needed for :last-child, only for :nth-last-child.

@munyagu
3 weeks ago

#2 @mukesh27
3 weeks ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
3 weeks ago

  • Milestone changed from Awaiting Review to 5.7

#4 @SergeyBiryukov
2 weeks ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 49914:

Twenty Twenty-One: Remove extra brackets from :last-child CSS pseudo-class.

Props munyagu, mukesh27, activecoder.
Fixes #52176.

Note: See TracTickets for help on using tickets.