The core of democratic theory is the consent of the governed; and there is nothing about that whatsoever that conflicts with Islam.
Indeed, it was only when the selection process of the ruler began to exclude the population, began to be indifferent to securing the consent of the governed, and control of the government became an inheritance passed from father to son; that marked the end of the Khilafah ar-Rashideen.
Legislating halaal and haraam according to public opinion is obviously kufr; however, selecting by popular vote who will run the affairs of the society, is obviously not.
The parameters of legislative power can easily be fixed within a framework of the Shari’ah, just as any government in a constitutional democracy cannot enact legislation that violates their constitution.
Government by a democratic selection process does not automatically mean denying the supremacy of the Shari’ah.
Of course, the supremacy of the Shari’ah is not subject to democratic ratification, there need not be any vote about whether or not the government must adhere to Islamic Law.
Once you have declared “la ilaaha illa Allah, Muhammad ar-Rasulullah” you have already cast your vote in favor of the Shari’ah. And if the government does not adhere to this, democratic mechanisms are the best way to unseat the ruler without causing turmoil in the society..