The EU has passed a new legislation that targets wasteful packaging, giving brands an 18-month grace period to comply.