The United Kingdom's departure from the EU took place on 31 January 2020 and the terms of this departure are stated in the in the the Withdrawal Agreement (Spanish version) negotiated by the EU and the UK. The Withdrawal Agreement entered into force on 1 February 2020 and establishes a series of provisions to ensure the United Kingdom leaves the EU in an orderly manner.
To this end, the Agreement established a transitional period until 31 December 2020, during which the EU legislation on freedom of movement continued to apply to United Kingdom nationals, so that they could continue to exercise their rights in the same way as they had been doing till then.
Therefore, those residing in Spain by 31 December 2020 and who continue to reside or work here thereafter, will have the same rights they have been enjoying, subject also to the same restrictions and limitations.
Similarly, UK frontier workers in Spain on 31 December 2020 are also protected by the Withdrawal Agreement, and will benefit of a specific procedure to get their documentation.