The question asks about Islamic law and how flexible it is. But there is not one thing that is Islamic law. There is, similarly, not one thing that is Shariah (to use an Arabic term here that may be familiar). There is the concept of Islamic law or jurisprudence, fiqh in Arabic, which would be law (or laws) that is consistent with and derived from either what is said in the Qur'an or shown by the behavior of Muhammad or contained in certain reports (hadith) of what was said by early members of the Muslim community in the circle of Muhammad. There are several schools of law, which give certain interpretations or express certain positions as law decisions, not one. There are those who treat a certain set (not always with the same ingredients or elements) of rules or rulings as core and sacrosanct (if I may use that term here), but there is no unanimity among them. And as there is no Pope or Papal Congress that would be recognized by all Muslims and all Muslim communities, there is no position statement that can definitively answer all questions. There is also a tradition in Islam jurisprudence (philosophy of law) of the earnest contemplating of relevant considerations to come up with creative and original conclusions of how best to deal with situations which were not dealt with in the time of Muhammad (or even in centuries after that). The Qur'an itself, by the way, is not a legal textbook and there are only a few topics that it presents that would be legalistic in nature. What we tend to have exposure to in the West is what comes out of Saudi Arabia, Iran, and more recently, declarations of Al Qaida and now Daesh (the name for the group in Syria and Northern Iraq that calls itself the Islamic State or ISIS or ISIL ... which other Muslims say is neither Islamic nor a State). That is quite non-representative to the great (large and impressive) history of Islamic jurisprudence.