The @import directive can be used inside a custom CSS/SASS code by defining an “ID” for the SASS custom code that needs to be imported (ex: vars.scss) and then using that ID as follows:
@import ‘vars.scss’;
in the SASS custom code that needs to import the other custom code.
If that doesn’t work, would you please make a few screenshots with the two custom SASS codes (the one that needs to be imported and the one where it needs to be imported) along with their options, so that I could try to replicate your usecase exactly on my test website and see what is wrong?