History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: IDEADEV-18667
Type: New Feature New Feature
Status: Open Open
Priority: Normal Normal
Assignee: Alexey Pegov
Reporter: Jonas Kvarnstrom
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
IDEA: Development

HTML inspection: Use of 'style' attribute

Created: 30 Mar 07 14:56   Updated: 22 Oct 08 08:29
Component/s: Code Analysis. Inspection, HTML.Editing
Fix Version/s: None

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 6,784
Severity: Medium


 Description  « Hide
I have a number of HTML files with explicit style="..." tags instead of using CSS classes. It would be nice to have a new inspection to detect such attributes. (If one exists, I haven't been able to find it.)

In the ideal case, there would also be one or more quickfixes. I can imagine a number of useful variations:

  • Extract a new CSS class
  • Extract a new CSS class, and ask whether all other occurrences of the same style="..." information should be replaced with this class too.
  • Replace style tag with use of an existing class matching the same style

But the inspection itself is more important, so tell me if you'd like me to put the quickfix suggestions as a separate SCR.



 All   Comments   Work Log   Change History      Sort Order:
Maxim Mossienko - 30 Mar 07 17:02
There is an intention in style attribute value to extract embedded css

Jonas Kvarnstrom - 30 Mar 07 17:27

Thanks for the tip! I'd still like to have an inspection, though.

I tried the intention and it suggested a selector, part of which was
"table#100%". I guess maybe it only checks whether the attribute
contains "id" rather the attribute IS "id", so it matches width="100%"
and believes this is an ID... It also doesn't seem to allow me to
create a new CSS class name.


Jonas Kvarnstrom - 22 Oct 08 08:29

Thanks for the tip! I'd still like to have an inspection, though.

I tried the intention and it suggested a selector, part of which was
"table#100%". I guess maybe it only checks whether the attribute
contains "id" rather the attribute IS "id", so it matches width="100%"
and believes this is an ID... It also doesn't seem to allow me to
create a new CSS class name.