473,811 Members | 3,314 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2852
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****@microsof t.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">Na me</span>
</div>
<div class="List Line">
<span class="name">Ar thur</span>
</div>
<div class="List Line">
<span class="name">Tr illian</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.co mwrote in message
news:ud******** ******@TK2MSFTN GP06.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">Na me</span>
</div>
<div class="List Line">
<span class="name">Ar thur</span>
</div>
<div class="List Line">
<span class="name">Tr illian</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.co mwrote in message
news:ud******** ******@TK2MSFTN GP06.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">Na me</span>
</div>
<div class="List Line">
<span class="name">Ar thur</span>
</div>
<div class="List Line">
<span class="name">Tr illian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamticall y 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.co mwrote in message
news:uP******** *****@TK2MSFTNG P06.phx.gbl...
Bob Altman wrote:
>"Göran Andersson" <gu***@guffa.co mwrote in message
news:ud******* *******@TK2MSFT NGP06.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">Na me</span>
</div>
<div class="List Line">
<span class="name">Ar thur</span>
</div>
<div class="List Line">
<span class="name">Tr illian</span>
</div>

Now, if I rename the style ".name" to ".person", would that also
autoamtical ly 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
9517
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 bb", "c:\cc dd" ); > But, I can't get it to work in my program, eg.
3
6064
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 hierarchical view of Parent Nodes and projects where in a projectnode can be added to any ParentNode and hence we may have a project node added to 100 Parent nodes. In this one, I have an operation of Renaming a Project Node. So whenever I am doing the...
1
2010
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 and renames them using the "Rename(oldfilename,newfilename)" function. Unfortunately, this function only seems to work if and only if it is preceeded by a 'msgbox("<some text>")'. ie. If I have the following the service sees the file
2
2967
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 some configuration problem in my IIS setup? Thanks,
3
6419
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 = FolderBrowserDialog1.SelectedPath above are the 2 lines of code i have so far, i would like to display/add the files to a list view and i feel that i would have to count the amount of files in the specified directory to do so, so how would i count the amount of files...
5
2737
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 called with an in-use file). However, what happens is that a copy of the file is made, and the old file still exists. For example: C:\>c:\python24\python.exe Python 2.4.2 (#67, Sep 28 2005, 12:41:11) on win32
6
2535
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 want to rename a batch of files..Such as I want to rename"1.avi,2.avi" to "Prison BreakS1E1.avi,Prison BreakS1E2.avi" in the same folder..How can I do?
1
5763
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... So say and update updates TABLE_A and I stop it, whilst this transaction is rolling back I attempt to rename TABLE_A to TABLE_A_OLD and rename a different table to become TABLE_A. I am assuming that the rollback actions will use the object...
92
3992
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 resource. If we search PHP, all results are programming resource. Second, python also means snake, snake is not a good thing in western culture. Many people dislike any things relevant to snake. We must have high regard for the custom.
0
9605
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10651
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10393
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.