[英]When editing css code within a Typescript file in Vscode all the text is red, how do i fix this?
這是正在發生的事情的圖片 [1]: https://i.stack.imgur.com/9yXUJ.png這是代碼。
export const GlobalStyle = createGlobalStyle`
html {
height: 100%;
}
body {
background-image: url(${BGImage});
background-size: cover;
margin: 0;
padding: 0 20px;
display: flex;
justify-content: center;
}
* {
font-family: 'Catamaran', sans-serif;
box-sizing: border-box;
}
`;
擴展vscode-styled-components可以幫助格式化和着色樣式組件中的代碼或不同文件中的類似代碼,包括.tsx
,對我來說,上面的示例如下所示:
紅色下划線是由於缺少帶下划線變量的 TypeScript 類型/函數。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.