There is no Pius XI code. In 1928, the Congregation for Religious issued a document exhorting teaching sisters to ensure modesty in girls schools. No specific standards were given. In 1930, the Congregation for the Council (which dealt with clergy, and has since been reorganized) issued a letter reiterating this, but exhorting bishops and others in authority like parish priests to see that it was done. Again, there were no specific standards given.
Some bishops established their own standards in their diocese, some left it to the parish, etc. The rules that are usually quoted are actually attributed to Cardinal Pompili, the vicar general of Rome (while the Pope is the diocesan bishop of Rome, since he’s usually busy with other stuff, another bishop is appointed as his vicar to actually run the diocese). These are the standards Pompili put in place for schools run by religious sisters in the diocese of Rome.
They became associated with Pius XI himself in 1959 when the Cardinal Archbishop of Manila, Rufino Santos, quoted them in a pastoral letter and associated them directly with the Pope.
They were spread around the US by a priest named Fr. Bernard Kunkel, who ran a modesty apostolate he started in the 50s, with a magazine/newsletter called the Marylike Crusader that included reference to Cardinal Santos’s letter in a 1963 issue. And from there, they entered the popular mythology of the trad-isphere.