Hi @Athulya Pillai
Currently we could not apply /inherit the theme in Webpart Page, this is by design.
Two web parts that are not available in SharePoint for Microsoft 365 modern pages are the Script editor web part and the Content editor web part. However, there are modern out-of-the-box web parts that can fulfill some of the same purposes. Or, you can create custom web parts or migrate your existing script editor web parts to the SharePoint Framework.
For more information, you could refer to:
https://support.microsoft.com/en-us/office/where-are-the-content-editor-and-script-editor-web-parts-in-sharepoint-ed6cc9ce-8b2a-480c-a655-1b9d7615cdbd
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.