Comments (8)
@ulrichb, Try changing the indent settings for LESS language.
LESS language is used in this plugin in styled-components strings because of LESS-like features like '&' selector.
And LESS, SASS, etc. languages have the IDE defaults set to 2 spaces (unlike CSS) for what seems like historical reasons.
from webstorm-styled-components.
@undeadcat Yes! It was the Less-"INDENT_SIZE" (I'v set it now to 4).
Thanks!
from webstorm-styled-components.
If your question is "Why is the code inside css`div .myDiv {color :red}`
not formatted?", the answer is:
It's not something that at the moment be fixed by this plugin. It's planned to be fixed in the IDE in 2018.2. These are the applicable issues: WEB-32480 and WEB-28540.
from webstorm-styled-components.
Thanks, changing INDENT_SIZE for LESS is help me
from webstorm-styled-components.
@undeadcat Is WEB-28540 also the reason, why TAB indents 2 spaces, although WebStorm is configured to 4 for the CSS language?
from webstorm-styled-components.
@ulrichb, Doesn't seem to be related to any of these issues.
I'm guessing you have 2 spaces configured in JS indent settings and 4 spaces in CSS? And wish to use 4 spaces within styled-components strings?
It works as expected for me using the latest WebStorm EAP.
Could you provide some more information - the IDE version you're using, a code sample than can be used to reproduce the issue?
from webstorm-styled-components.
Hi @undeadcat
Thanks for your reply!
I have a "Tab size" and "Indent" for JS, TS, and CSS set to 4 (I think the default of WebStorm).
.... still, when hitting the TAB key, the cursor moves 2 chars (instead of 4).
BUT: When selecting text, it correctly gets indented by 4 chars.
Also when hitting TAB in the surrounding TS code, the cursor moves by 4 chars.
Using WS 2018.2.3.
from webstorm-styled-components.
Also note that this plugin seems to cause it because in "normal" (non styled-comp) tagged strings, the cursor also 4 chars.
from webstorm-styled-components.
Related Issues (20)
- Is there no highlight and prompt when used with tailwind?
- Is there no highlight and prompt when used with tailwind?
- [Feature Request] Show which HTML tag is used
- Problem with media queries HOT 1
- Wrong hex-color format and No auto line-break with Emmet HOT 1
- Indent size is ignored and only works on first line
- Support for xstyled/styled-components
- plugin doesn't work in intellij 2022.3.2 HOT 1
- Feature request: support vars as "value" strings, not just key-value css strings HOT 2
- Selector is never used HOT 1
- \t chapter in copy-pasted code HOT 4
- styled-components-breakpoints support
- [Bug][Typescript] Very slow props suggestions and no value suggestions when when using styled.div syntax
- Pls Fix Webstorm 2020.2 compatibility issue HOT 1
- Re-configure branch protection policy for this repo HOT 2
- String interpolation not being autocompleted
- Issues with parsing & signs HOT 3
- [Feature Request] Refactor to styled component HOT 2
- Webstorm 2020.3 - not working HOT 7
- Highlight var in template string
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webstorm-styled-components.