A major New York City hospital illegally changed its dress code policy without first bargaining with its union, a National Labor Relations Board judge ruled.

New York Presbyterian Brooklyn Methodist Hospital failed to show the uniform requirement wasn’t a “mandatory, substantial, or significant” change to workers’ employment terms and conditions,Administrative Law Judge Michael P. Silverstein said in a Thursday opinion.

It therefore violated federal labor law by making the change without negotiating with the New York State Nurses Association, he wrote.

The hospital implemented the dress code change — which included mandatory navy blue pants and white tops for …