The UK Supreme Court is changing the contours of the British constitution in ways that will have profound significance for Parliament, for governments (in both London and Edinburgh), and for devolution.

The Court’s latest pronouncement – last week, in a case concerned in the main with children’s rights – deepens a trend that started three years ago, designed to protect and safeguard the sovereignty of the UK Parliament.

It was when Boris Johnson fell foul of this trend that the public first paid attention. His attempt to prorogue Parliament, preventing it from debating and voting on Brexit in the crucial run-up to Britain eventually leaving the EU, was ruled unlawful. Why? Because the Court declared that no government could use its powers to thwart Parliament.

Last week it was not the prime minister in the dock, but the Scottish Government. Legislation passed earlier this year by Holyrood sought to give greater protection in Scots law to children’s rights. No problem with that. But, in doing so, Holyrood had provided that laws passed by Westminster had to be read and given effect subject to certain provisions of the UN Convention on the Rights of the Child. This, Holyrood has no power to do. Why? Because it falls foul of the same principle that Boris Johnson had breached.

Parliament must be left free and unencumbered to do its job: so said the Supreme Court. It is for Parliament to hold the government to account (which was why Mr Johnson could not lawfully prorogue it). Likewise, it is for Parliament to decide how to legislate for the United Kingdom (which is why Holyrood cannot impose conditions on how Parliament makes law).

If Westminster wants to provide that its laws should be read and given effect by the courts subject to some international treaty, so be it. Parliament has indeed done so, in the Human Rights Act 1998. But no one else has the power to instruct the courts to interpret and give legal effect to Westminster legislation subject to conditions imposed by others. Only Parliament itself may do that.

Thus, if Holyrood (or any other devolved legislature) seeks to impose terms and conditions of its own on how Acts of Parliament made in Westminster are to operate, that will be unlawful as running contrary to the constitutional law of devolution.

This is a feature of our law of devolution which has always been there. It finds its root in an otherwise obscure provision of the Scotland Act (replicated in the devolution statutes for Wales and Northern Ireland) that “the power of the Parliament of the United Kingdom to make laws for Scotland” is not affected by the creation of devolved institutions. This is section 28(7). Until 2018, no one paid this provision much regard. It looked like boilerplate – restating the obvious, rather than making any profound statement of constitutional law.

Then came Brexit and, in particular, the Scottish Parliament’s attempts to ensure that, Brexit notwithstanding, EU law could continue to operate in Scotland. Holyrood passed a so-called Continuity Bill. Much of it was challenged in the Supreme Court. I confess to being shocked, as well as surprised, when much of that challenge proved unsuccessful. But one provision in the Continuity Bill was struck down on the ground that it violated the principle in s 28(7).

Eagle-eyed constitutional lawyers were at once on high alert. What other provisions of Holyrood legislation, they wondered, could be struck down because they interfered with the Westminster Parliament’s ongoing legal right to make laws for Scotland?

At first blush, most of the Supreme Court’s 2018 judgment in the Continuity Bill Reference looked like a victory for the Scottish Government. Holyrood has no power to make laws relating to a matter reserved to Westminster. The UK’s international affairs, including the country’s relations with the European Union, are a reserved matter.

The Herald: Prime Minister Boris Johnson

On one view, the whole of the Continuity Bill should have been struck down on the basis that it impermissibly related to a matter reserved to Westminster. But this is not even remotely the view that the Supreme Court took. All of a sudden, the safeguard that Holyrood may not make law relating to a reserved matter looked hollow – emptied of content.

That apparent victory, however, may yet turn out to have sown the seeds of bitter defeat, from the Scottish Government’s perspective. For, even if that judgment loosened Westminster’s grip on matters supposedly reserved to it, the Supreme Court at the same time started breathing not just life but fire into section 28(7).

We saw the first repercussions last week. Yes, Holyrood can strengthen children’s rights in Scots law. Yes, Holyrood can require its own legislation to be read and given effect subject to the UN Convention on the Rights of the Child. But can Holyrood require also that Westminster’s legislation is curtailed in this way? No it cannot.

And here is the rub. Child and family law are not reserved to Westminster: in Scotland, they are devolved. When the Scotland Act was written it was assumed that the main check on Holyrood’s law-making competence would be the apparently all-important divide between reserved and devolved matters. The former are for Westminster; the latter are for Holyrood.

But in the Supreme Court’s case law it has not turned out that way. Rather, the justices have based their decisions on other contours. It’s not what’s reserved that matters. It’s that, whether we are talking about reserved or devolved matters, nothing Holyrood does may impede Westminster’s sovereign ability to make effective laws for all four nations of the United Kingdom, Scotland included.

The Herald:

That may turn out to be a more potent limitation on the Scottish Parliament’s legislative competence than had previously been realised. The elephant in the room, of course, is any future Holyrood Bill paving the way for a second independence referendum. If such a Bill were to be passed and if such a Bill were then referred to the Supreme Court, what then?

Judging by last week’s ruling, the Bill would surely be struck down. Not because it would relate to the reserved matter of the UK constitution. But because it would impede Parliament’s ability to make effective law for the UK. The Supreme Court is not going to let that happen.

Our columns are a platform for writers to express their opinions. They do not necessarily represent the views of The Herald.