473,807 Members | 2,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Theme Constants?

Is there such a thing as defining a constant (or a variable) for a
theme? For example, storing a color code and then using it in 4 or 5
places, so to change the color I only have to edit one line?

TIA

Jun 19 '07
12 1525
Yes, I am fairly familiar with CSS, and am aware that there is no way
to have variables or constants in a CSS.

For example, I know this will not work:

#define HIGHLIGHT = #FFFFFF

a.navigation:ho ver {
color: HIGHLIGHT;
}

td.sidebar {
border-color: HIGHLIGHT;
}

Note that these are two different elements and two different classes.
BUT if I wanted to change the highlight, I could change it in *1 place
only*.

There are various resources available on Google that say this exact
scenario IS NOT POSSIBLE.

My question remains ... *** Is there any way to do this via ASP.NET
themes? ***

On Jun 19, 2:16 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
there's unlimited resources for css tutorials and examples via google.

a simple css class looks like :

.sidebar {
font-size:11px;
margin-top:2px

}applied it looks like:<div class="sidebar" >sidebar stuff here</div>
"T. Church" <tlchu...@gmail .comwrote in messagenews:11* *************** *****@w5g2000hs g.googlegroups. com...
Either I'm being obtuse or I'm not explaining myself correctly ...
hopefully it's the former.
Can you give an example of what my CSS will look like so for each
color on my palette, I only set it once and can change it easily?
On Jun 19, 1:26 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
Sounds like you are referring to a css class
define the class and it is applied to the control whenever.
Change the class color and it is reflected everywhere it is used.
>Is there such a thing as defining a constant (or a variable) for a
theme? For example, storing a color code and then using it in 4 or 5
places, so to change the color I only have to edit one line?
TIA

Jun 19 '07 #11
Everything is possible. Depends how much money you have.

Your CSS file can be dynamicly created with .NET code.
Simply have in your HTML files instead of
<link rel="stylesheet " type="text/css" href="my.css">
have it like
<link rel="stylesheet " type="text/css" href="my.aspx">
And your my.aspx can load my.css file and perfom the substitution.
so my.css has
a.navigation:ho ver {
color: @HIGHLIGHT@;
}

td.sidebar {
border-color: @HIGHLIGHT@;
}
and my.aspx will have folowing code
using (StreamReader sr = new StreamReader("m y.css"))
{
strinf s = sr.ReadToEnd();
s.Replace("@HIG HLIGHT@", "#FFFFFF");
}

George

"T. Church" <tl******@gmail .comwrote in message
news:11******** **************@ q75g2000hsh.goo glegroups.com.. .
Yes, I am fairly familiar with CSS, and am aware that there is no way
to have variables or constants in a CSS.

For example, I know this will not work:

#define HIGHLIGHT = #FFFFFF

a.navigation:ho ver {
color: HIGHLIGHT;
}

td.sidebar {
border-color: HIGHLIGHT;
}

Note that these are two different elements and two different classes.
BUT if I wanted to change the highlight, I could change it in *1 place
only*.

There are various resources available on Google that say this exact
scenario IS NOT POSSIBLE.

My question remains ... *** Is there any way to do this via ASP.NET
themes? ***

On Jun 19, 2:16 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
>there's unlimited resources for css tutorials and examples via google.

a simple css class looks like :

.sidebar {
font-size:11px;
margin-top:2px

}applied it looks like:<div class="sidebar" >sidebar stuff here</div>
"T. Church" <tlchu...@gmail .comwrote in
messagenews:11 *************** ******@w5g2000h sg.googlegroups .com...
Either I'm being obtuse or I'm not explaining myself correctly ...
hopefully it's the former.
Can you give an example of what my CSS will look like so for each
color on my palette, I only set it once and can change it easily?
On Jun 19, 1:26 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
Sounds like you are referring to a css class
>define the class and it is applied to the control whenever.
>Change the class color and it is reflected everywhere it is used.
>>Is there such a thing as defining a constant (or a variable)
for a
theme? For example, storing a color code and then using it in 4
or 5
places, so to change the color I only have to edit one line?
TIA


Jun 19 '07 #12
perhaps save it as an asp file to have dynamic content.
<% HIGHLIGHT = "#FFFFFF" %>

a.navigation:ho ver {
color: <%= HIGHLIGHT %>;
}

Not sure how this would translate to ASP.net themes.

"T. Church" <tl******@gmail .comwrote in message news:11******** **************@ q75g2000hsh.goo glegroups.com.. .
Yes, I am fairly familiar with CSS, and am aware that there is no way
to have variables or constants in a CSS.

For example, I know this will not work:

#define HIGHLIGHT = #FFFFFF

a.navigation:ho ver {
color: HIGHLIGHT;
}

td.sidebar {
border-color: HIGHLIGHT;
}

Note that these are two different elements and two different classes.
BUT if I wanted to change the highlight, I could change it in *1 place
only*.

There are various resources available on Google that say this exact
scenario IS NOT POSSIBLE.

My question remains ... *** Is there any way to do this via ASP.NET
themes? ***

On Jun 19, 2:16 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
>there's unlimited resources for css tutorials and examples via google.

a simple css class looks like :

.sidebar {
font-size:11px;
margin-top:2px

}applied it looks like:<div class="sidebar" >sidebar stuff here</div>
"T. Church" <tlchu...@gmail .comwrote in messagenews:11* *************** *****@w5g2000hs g.googlegroups. com...
Either I'm being obtuse or I'm not explaining myself correctly ...
hopefully it's the former.
Can you give an example of what my CSS will look like so for each
color on my palette, I only set it once and can change it easily?
On Jun 19, 1:26 pm, "Jon Paal [MSMD]" <Jon[ nospam ]Paal @ everywhere
dot comwrote:
Sounds like you are referring to a css class
>define the class and it is applied to the control whenever.
>Change the class color and it is reflected everywhere it is used.
>>Is there such a thing as defining a constant (or a variable) for a
theme? For example, storing a color code and then using it in 4 or 5
places, so to change the color I only have to edit one line?
TIA


Jun 19 '07 #13

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

Similar topics

1
8010
by: Joey | last post by:
Hello, I have tried to programmatically set the theme for my master page by putting code in a "Page_PreInit" fuction in the master page's code behind. However, when I set a breakpoint there and run the app, the breakpoint is never hit. Of course my theme is not being applied. The above procedure works fine for any content page, but obviously doesn't work for my master page. So, how does one properly and programmatically set a theme...
1
1762
by: Ron | last post by:
I have an application that requires a login at each visit to the site and can only be accessed by a login. A user can have different themes depending if it was assigned in there profile. Theme A is considered the default theme for the site But different users can have different themes. User A has Theme A User B has Theme B Logs in sees Theme A During Login sees Theme A after login sees Theme B
11
6536
by: greg | last post by:
Hi all, Is there a way to get the current theme name at design time? I'm trying to write a custom control for which I need to use images from the current theme. I have asigned a theme to the page as well as in the web.config. The control looks ok at run time but when viewed in the Visual Studio designer it cannot pick up the current theme.
1
1287
by: grexican | last post by:
Hello, I'm working with some third-party JS code, such as mootools and moo.fx, among a few others. They have some really nice "flashy" features, such as fading from one color to another to bring attention. I would like to use these settings, but I am currently restricted to a single theme (more specifically, one color scheme), because you must specify the start and stop color in JS. If I could "theme" JS files, then I could create a...
0
9720
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9599
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
10372
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...
0
10112
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
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
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...
1
4330
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.