The design side and development side of a website are two separate skills and while some people enjoy doing both and offering the full package, it’s not necessary to do both to be a good designer. The more you focus on one specific skill, the better you will be at it.
While you don’t have to be able to write production-ready code, having a good basic understanding of it helps you speak the same language as the developer you work with, and helps you understand the limitations and possibilities in building your design.
You should learn the skills you’re interested in. Not every web designer needs to be able to code their own sites, and unless you want a job where you do both design and development you may be better off using your time to learn other things.