Dusty's mom, sanctuary cities are not cities that break federal law. "Sanctuary city" has no legal meaning. It is not against federal law for cities to prevent their law enforcement officers from inquiring about individual's immigration status. It is (as of 1996) against federal law for cities to prevent employees from reporting an individual's immigration status, if they know that immigration status. Before 1996, there was no way for local government officials (including police) to do anything themselves about illegal immigrants: that was a sole power of the federal government. The same legislation that made preventing employees from reporting immigration status illegal also made it possible for local governments to go through a process to deputize people to enforce federal immigration law, but very few states and cities do this (because it costs money to enforce laws).
I understand a "sanctuary city" to be a place where the local government tries to make the local infrastructure and laws operate as smoothly as possible, by getting as many people as possible to report crimes to the local law enforcement and to go the hospital and the like.