You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2007/07/05 22:52:04 UTC

[jira] Created: (TRINIDAD-89) Server side CSS constants for .css files

Server side CSS constants for .css files
----------------------------------------

                 Key: TRINIDAD-89
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
             Project: MyFaces Trinidad
          Issue Type: Improvement
          Components: Skinning
    Affects Versions: 1.0.2-core
            Reporter: Leonardo Uribe
         Attachments: patchConstants6.patch

 Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:

@constants {
	greencolor: #97f099;
	f90color : #f90; 
}

.AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
    background: greencolor;
    color: f90color;
}

Like in server side CSS in PHP.

I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
(If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.

Suggestion for improvements of this topic are welcome.




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Jeanne Waldman (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512979 ] 

Jeanne Waldman commented on TRINIDAD-89:
----------------------------------------

We have this feature with aliases. And it seems that aliases are more useful, because you can have more than one css property per alias.

.AFDefaultFont:alias {
  -tr-rule-ref: selector(".AFFontFamily:alias");
  font-size: 11px;
}

af|inputText::content { 
  -tr-rule-ref: selector(".AFDefaultFont:alias");
}

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Leonardo Uribe updated TRINIDAD-89:
-----------------------------------

    Status: Patch Available  (was: Open)

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12512990 ] 

Leonardo Uribe commented on TRINIDAD-89:
----------------------------------------

Yes, I has noted before that this is true. But the aliases has its drawback. For example:

@constants {
	greencolor: #97f099;
	f90color : #f90; 
}

/*..... ....*/

.AFPanelNavigationHorizontal ul li.on ul {    
    display: block;
    background: f90color;
}
.AFPanelNavigationHorizontal ul li.on:hover ul, .AFPanelNavigationHorizontal ul li.over ul { /*for ie*/
    background: greencolor;
}
.AFPanelNavigationHorizontal ul li a {
    color: #B510D;
    font-weight: bold;
    display: block;
    padding: 5;
}
.AFPanelNavigationHorizontal ul li.on a {   
    color: #fff;
    background: f90color;
}
.AFPanelNavigationHorizontal ul li.on ul a, .AFPanelNavigationHorizontal ul li.off ul a {
    float: left; /*ie doesn't inherit the float*/
    border: 0;
    color: f90color;
    width: auto;    
}

Please note that in this case, the constant f90color are used in the following properties:

color
background

The example was adapted from the css file of the examples of tomahawk component called panelNavigation.

Theorically, you have to define 4 alias classes to do the same or do not use it at all. The practical problem is if I want to
change the color theme of a skin, I have to change on its 4 alias selectors or in all the css file. I feel that constants are more
clear and easy to understand than use aliases, but this is my particular opinion.

But thinking more from other point of view, maybe the only example that this is true and it has a practical value is with color properties.
The other scenarios of need to group properties could be done with aliases. =| 

Anyway, thanks for your efford and guide illustrating that point of view.

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597547#action_12597547 ] 

Andrew Robinson commented on TRINIDAD-89:
-----------------------------------------

If this were implemented as in the patch, I personally would prefer to see a more obvious way to note that the value is a constant (some syntax like ${constant.name})

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Andrew Robinson (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12597543#action_12597543 ] 

Andrew Robinson commented on TRINIDAD-89:
-----------------------------------------

Isn't this what aliases are for and then using -tr-rule-ref to import them?

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TRINIDAD-89) Server side CSS constants for .css files

Posted by "Martin Marinschek (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-89?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513574 ] 

Martin Marinschek commented on TRINIDAD-89:
-------------------------------------------

Hi,

I also think these constants might be useful for other stuff where margins, borders, widths and heights of some components are the same - but with different property names.

E.g. the height of one component might be the margin of another component.

Does that make sense as an additional use-case to the color use-case?

regards,

Martin

> Server side CSS constants for .css files
> ----------------------------------------
>
>                 Key: TRINIDAD-89
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-89
>             Project: MyFaces Trinidad
>          Issue Type: Improvement
>          Components: Skinning
>    Affects Versions: 1.0.2-core
>            Reporter: Leonardo Uribe
>         Attachments: patchConstants6.patch
>
>
>  Working in my Google Summer of Code, I have found that It would be cool, when you define a css skin file that you can do something like this:
> @constants {
> 	greencolor: #97f099;
> 	f90color : #f90; 
> }
> .AFPanelNavigationHorizontal ul li.off a:hover, .AFPanelNavigationHorizontal ul li:hover a, .AFPanelNavigationHorizontal ul li.over a {
>     background: greencolor;
>     color: f90color;
> }
> Like in server side CSS in PHP.
> I have created a patch that adds this feature. With this, yo can define local constants variables in a .css file that is used as trinidad skin file.
> (If you define a constant in a base skin, the extended skins don't see it). It's a simple but powerful idea.
> Suggestion for improvements of this topic are welcome.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.