473,399 Members | 2,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Rename a CSS style?

Using VS 2008 SP1, is there a way to rename a CSS style and all of the
references to that style (short of doing a global find-and-replace in the
code)? You'd think that the Manage Styles and Apply Styles windows would
have a simple "rename this style" option that does this, but I can't find
it...

TIA - Bob

Aug 28 '08 #1
7 2810
Hi Bob,

This feature is not supported in VS 2008. As mentioned in MSDN:
http://msdn.microsoft.com/en-us/library/6kxxabwd.aspx.
"Rename is a refactoring feature in the Visual Studio integrated
development environment (IDE) that provides an easy way to rename
identifiers for code symbols such as fields, local variables, methods,
namespaces, properties, and types. "
However CSS style is not included in its support list.

In the meanwhile, I will suggest you to submit a new feature request at
http://connect.microsoft.com/VisualStudio.

If you have any other questions or concerns, please do not hesitate to
contact us. It is our pleasure to be of assistance. Have a nice day.

Regards,
Hongye Sun (ho*****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subs...#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/...tance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Aug 29 '08 #2
Bob Altman wrote:
Using VS 2008 SP1, is there a way to rename a CSS style and all of the
references to that style (short of doing a global find-and-replace in
the code)? You'd think that the Manage Styles and Apply Styles windows
would have a simple "rename this style" option that does this, but I
can't find it...

TIA - Bob
As CSS can use multiple identifiers, it's not that simple to determine
what to refactor and what not to refactor. Perhaps you use CSS in a way
that it looks very simple, but it's easy to show an example where it
would be rather complex.

Consider this CSS:

..List span { float: left; }
..Header .name { background: #000; color: #fff; }
..Line .name { color: #009; }
..name { width: 100px; }

And this HTML:

<div class="List Header">
<span class="name">Name</span>
</div>
<div class="List Line">
<span class="name">Arthur</span>
</div>
<div class="List Line">
<span class="name">Trillian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamtically rename ".Header .name" to ".Header .person" and ".Line
..name" to ".Line .person"? If not, should the classes in the html be
changed from "name" to "name person" instead of "person"?

--
Göran Andersson
_____
http://www.guffa.com
Aug 29 '08 #3
"Göran Andersson" <gu***@guffa.comwrote in message
news:ud**************@TK2MSFTNGP06.phx.gbl...
Bob Altman wrote:
>Using VS 2008 SP1, is there a way to rename a CSS style and all of the
references to that style (short of doing a global find-and-replace in the
code)? You'd think that the Manage Styles and Apply Styles windows would
have a simple "rename this style" option that does this, but I can't find
it...

TIA - Bob

As CSS can use multiple identifiers, it's not that simple to determine
what to refactor and what not to refactor. Perhaps you use CSS in a way
that it looks very simple, but it's easy to show an example where it would
be rather complex.

Consider this CSS:

.List span { float: left; }
.Header .name { background: #000; color: #fff; }
.Line .name { color: #009; }
.name { width: 100px; }

And this HTML:

<div class="List Header">
<span class="name">Name</span>
</div>
<div class="List Line">
<span class="name">Arthur</span>
</div>
<div class="List Line">
<span class="name">Trillian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamtically rename ".Header .name" to ".Header .person" and ".Line
.name" to ".Line .person"? If not, should the classes in the html be
changed from "name" to "name person" instead of "person"?
--
Göran Andersson
I don't understand the "if not" option in the example above. As I read the
example, that's equivalent to adding a new "person" rule (in addition to the
existing "name" rule), which is not the same as renaming the "name" rule to
"person". If I rename the style ".name" to ".person" then class "name" no
longer exists and can not be referenced from the HTML. I would expect the
HTML to be modified so that every "computed" reference to class "name" is
changed to "person".

Bob

Aug 30 '08 #4
Bob Altman wrote:
"Göran Andersson" <gu***@guffa.comwrote in message
news:ud**************@TK2MSFTNGP06.phx.gbl...
>Bob Altman wrote:
>>Using VS 2008 SP1, is there a way to rename a CSS style and all of
the references to that style (short of doing a global
find-and-replace in the code)? You'd think that the Manage Styles
and Apply Styles windows would have a simple "rename this style"
option that does this, but I can't find it...

TIA - Bob

As CSS can use multiple identifiers, it's not that simple to determine
what to refactor and what not to refactor. Perhaps you use CSS in a
way that it looks very simple, but it's easy to show an example where
it would be rather complex.

Consider this CSS:

.List span { float: left; }
.Header .name { background: #000; color: #fff; }
.Line .name { color: #009; }
.name { width: 100px; }

And this HTML:

<div class="List Header">
<span class="name">Name</span>
</div>
<div class="List Line">
<span class="name">Arthur</span>
</div>
<div class="List Line">
<span class="name">Trillian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamtically rename ".Header .name" to ".Header .person" and ".Line
.name" to ".Line .person"? If not, should the classes in the html be
changed from "name" to "name person" instead of "person"?
--
Göran Andersson

I don't understand the "if not" option in the example above. As I read
the example, that's equivalent to adding a new "person" rule (in
addition to the existing "name" rule), which is not the same as renaming
the "name" rule to "person". If I rename the style ".name" to ".person"
then class "name" no longer exists and can not be referenced from the
HTML. I would expect the HTML to be modified so that every "computed"
reference to class "name" is changed to "person".

Bob
Yes, but you are missing the point. If you rename the style ".name",
should the styles ".Header .name" and ".Line .name" be automatically
renamed also?

--
Göran Andersson
_____
http://www.guffa.com
Aug 30 '08 #5
"Göran Andersson" <gu***@guffa.comwrote in message
news:uP*************@TK2MSFTNGP06.phx.gbl...
Bob Altman wrote:
>"Göran Andersson" <gu***@guffa.comwrote in message
news:ud**************@TK2MSFTNGP06.phx.gbl...
>>Bob Altman wrote:
Using VS 2008 SP1, is there a way to rename a CSS style and all of the
references to that style (short of doing a global find-and-replace in
the code)? You'd think that the Manage Styles and Apply Styles windows
would have a simple "rename this style" option that does this, but I
can't find it...

TIA - Bob

As CSS can use multiple identifiers, it's not that simple to determine
what to refactor and what not to refactor. Perhaps you use CSS in a way
that it looks very simple, but it's easy to show an example where it
would be rather complex.

Consider this CSS:

.List span { float: left; }
.Header .name { background: #000; color: #fff; }
.Line .name { color: #009; }
.name { width: 100px; }

And this HTML:

<div class="List Header">
<span class="name">Name</span>
</div>
<div class="List Line">
<span class="name">Arthur</span>
</div>
<div class="List Line">
<span class="name">Trillian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamtically rename ".Header .name" to ".Header .person" and ".Line
.name" to ".Line .person"? If not, should the classes in the html be
changed from "name" to "name person" instead of "person"?
--
Göran Andersson

I don't understand the "if not" option in the example above. As I read
the example, that's equivalent to adding a new "person" rule (in addition
to the existing "name" rule), which is not the same as renaming the
"name" rule to "person". If I rename the style ".name" to ".person" then
class "name" no longer exists and can not be referenced from the HTML. I
would expect the HTML to be modified so that every "computed" reference
to class "name" is changed to "person".

Bob

Yes, but you are missing the point. If you rename the style ".name",
should the styles ".Header .name" and ".Line .name" be automatically
renamed also?
You're right, I missed the fact that you have two identifiers in the style
name. What does that syntax do? I did some (brief) searching online and in
the MSDN docs, but I can't find anything that mentions that syntax.

Bob

Aug 31 '08 #6
Bob Altman wrote:
You're right, I missed the fact that you have two identifiers in the
style name. What does that syntax do? I did some (brief) searching
online and in the MSDN docs, but I can't find anything that mentions
that syntax.

Bob
You can mix any number of class names, id names and element names in the
style selector, and even combine them and describe relations between them.

For example, matching an img element inside a link with class="left",
inside a div with class="Main" inside an element with id="Menu":

#Menu div.Main a.left img { ... }

I find this web site quite useful for understanding how a selector can
be assembled:

http://css.maxdesign.com.au/selectutorial/

--
Göran Andersson
_____
http://www.guffa.com
Aug 31 '08 #7
I find this web site quite useful for understanding how a selector can
be assembled:

http://css.maxdesign.com.au/selectutorial/

Thanks Göran! As I've said in other recent posts, I'm an experienced
desktop and enterprise app kind of guy, but I'm just starting to learn the
Mysterious Ways of the Web Developer. The stuff I've read about CSS up to
now (in the MSDN "how do" docs and on a couple of websites) oversimplified
things (by omitting the concept of selectors) to the point where I was let
to believe that there was a much more linear relationship between CSS rules
and the HTML markup that referenced them.

Sep 1 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Tom | last post by:
I'm having a problem using a path with spaces as a parameter to os.rename() in a program on WinXP. This works fine at the command line (where the folder "c:\aa bb" exists) > os.rename( "c\aa...
3
by: Saradhi | last post by:
Hi All, Here I am facing a performance problem with the TreeView Node renaming. I am displaying a hierarchy Data in a treeview in my Windows C# Application. My tree view represents an...
1
by: Jay at SCA | last post by:
I've been having the following issue with a windows service I've created in vb.net (.net fw 1.1): Basically, my service monitors a folder for the creation of any new files of a particular type...
2
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there...
3
by: glub glub | last post by:
i'm trying to make a program that works as Replace works in MS Word but this is for use with files, not a text document. FolderBrowserDialog1.ShowDialog() txtPath.Text =...
5
by: Tony Meyer | last post by:
On Windows, if I do os.rename(old, new) where old is a file that is in-use (e.g. python itself, or a dll that is loaded), I would expect that an error would be raised (e.g. as when os.remove is...
6
by: shuaishuaiyes | last post by:
Hello everyone... I'm a Chinese student and my English is very poor...So excuse me if I make grammar mistake. I want to ask some questions about "rename". I'm a beginner, so my C ..... :) I...
1
by: cheesey_toastie | last post by:
I have a long query which I have set off and would like to stop, and rename one of the tables used. My query is due to my lack of understanding of the underlying structure of MSSQL-Server... ...
92
by: ureuffyrtu955 | last post by:
Python is a good programming language, but "Python" is not a good name. First, python also means snake, Monty Python. If we search "python" in google, emule, many results are not programming...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.