You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Harish Krishnaswamy <hk...@comcast.net> on 2003/12/12 22:33:03 UTC
Components with style
Hi,
A lot of the components I have developed have their own stylesheets that have to manually
incorporated into the pages to render appropriately. Instead can we not provide the ability to
bundle stylesheets with the component like we bundle javascript? It seems simple to me, but I have
missed the boat on a number of occasions in the past so what do you think?
-Harish
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Harish Krishnaswamy <hk...@comcast.net>.
CSS by nature takes care of this part. All we have to make sure, I think, is that the ordering of
the stylesheets are so that the link to page's stylesheet is rendered as the last.
-Harish
Howard M. Lewis Ship wrote:
> To think about: incorporating style is largely good, but what about components where you want to
> allow the app to override the L&F via stylesheets? Think about what that might look like. When we
> solve this, we want to try and solve it once and only once.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
>
>>-----Original Message-----
>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
>>Sent: Friday, December 12, 2003 4:33 PM
>>To: Tapestry development
>>Subject: Components with style
>>
>>
>>Hi,
>>
>>A lot of the components I have developed have their own
>>stylesheets that have to manually
>>incorporated into the pages to render appropriately. Instead
>>can we not provide the ability to
>>bundle stylesheets with the component like we bundle
>>javascript? It seems simple to me, but I have
>>missed the boat on a number of occasions in the past so what
>>do you think?
>>
>>-Harish
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
RE: Components with style
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
To think about: incorporating style is largely good, but what about components where you want to
allow the app to override the L&F via stylesheets? Think about what that might look like. When we
solve this, we want to try and solve it once and only once.
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Friday, December 12, 2003 4:33 PM
> To: Tapestry development
> Subject: Components with style
>
>
> Hi,
>
> A lot of the components I have developed have their own
> stylesheets that have to manually
> incorporated into the pages to render appropriately. Instead
> can we not provide the ability to
> bundle stylesheets with the component like we bundle
> javascript? It seems simple to me, but I have
> missed the boat on a number of occasions in the past so what
> do you think?
>
> -Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Vince Marco <vm...@mac.com>.
I've found that the following CSS stylesheet organization works well:
organization.css
|
project.css
|
application.css
|
page.css (frequently not used)
This is twice as many as you suggest, but unused stylesheets generally
go unchanged and for the most part remain invisible to the project
efforts. As projects proliferate this type of approach can provide
much value. I think the key to this type of org structure is to
automatically pull in the application level and up stylesheets, and let
the page level be optional (perhaps in the page spec).
But then again, I've had no problems in the past managing these
stylesheets myself within the components. Just be careful that
whatever CSS organization you end up doing doesn't prevent me from
doing my own CSS organization.
Vince
On Dec 13, 2003, at 9:38 AM, Erik Hatcher wrote:
> Keep in mind one of Tapestry's underlying principals to keep concerns
> separate and let HTML be clean and totally within a designers hands.
> CSS is another layer on top of the *structure* that HTML provides.
> CSS is not something us "coders" are writing... it is really in a
> layer above the structure and very much in the hands of the designers
> if we are fortunate enough to have such artistic people handy on our
> projects. So, we need to tread carefully here to ensure that we make
> it such that designers are allowed to work they need and want work.
>
> And it seems a single master stylesheet is how things are done and
> perhaps one (or more) overriding ones for special sections of a site
> or individual pages, or for different media types. Right?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Thinking about it now, I should probably change my organization to the following.
component level -> company level -> project level -> page level
This way I can override the component style at what ever level I want.
-Harish
Harish Krishnaswamy wrote:
> Designer's will certainly be responsible for the style either way. My
> only suggestion is to bundle the CSS for the component with the
> component so you don't *have* to specify styles to use the component,
> altough you can if you prefer a different style by overriding the one
> bundled with the component.
>
> I have the following organization for my stylesheets. Specificity:
> left(least specific) to right(most specific).
>
> company level -> project level -> component level -> page level
>
> And I have CSS for every component and every page.
>
> Here I can specify my company level and project level stylesheets in the
> Border and I can specify the page level stylesheet in the page spec, but
> I have no one place to specify the stylesheets for the components. I
> have to specify them in each page I use the component which is what I am
> trying to avoid.
>
> -Harish
>
> Erik Hatcher wrote:
>
>> Keep in mind one of Tapestry's underlying principals to keep concerns
>> separate and let HTML be clean and totally within a designers hands.
>> CSS is another layer on top of the *structure* that HTML provides.
>> CSS is not something us "coders" are writing... it is really in a
>> layer above the structure and very much in the hands of the designers
>> if we are fortunate enough to have such artistic people handy on our
>> projects. So, we need to tread carefully here to ensure that we make
>> it such that designers are allowed to work they need and want work.
>>
>> And it seems a single master stylesheet is how things are done and
>> perhaps one (or more) overriding ones for special sections of a site
>> or individual pages, or for different media types. Right?
>>
>>
>>
>> On Saturday, December 13, 2003, at 10:50 AM, Harish Krishnaswamy wrote:
>>
>>> I think that would be against the design intent of CSS. CSS is
>>> designed so that the author can provide a style for a page and the
>>> user can override it if he/she wishes to do so. Moreover managing a
>>> single stylesheet would soon become out of control if all pages use a
>>> lot of CSS like mine. Without style, I think, the component would not
>>> be complete as it cannot render appropriately. What we need is a way
>>> to let the pages override the style provided by the component like
>>> Howard suggests and I think CSS takes care of that part. We just have
>>> to take care that the order of the CSS links is appropriate.
>>>
>>> -Harish
>>>
>>> Erik Hatcher wrote:
>>>
>>>> It seems to me that one stylesheet is preferable over lots of
>>>> separate ones though - so that a designer could alter the styles in
>>>> one spot easily. Components should provide the ability to attach a
>>>> class or id to pieces of what it renders, though, but I don't think
>>>> it is the components job to provide actual styles.
>>>> On Friday, December 12, 2003, at 04:33 PM, Harish Krishnaswamy wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> A lot of the components I have developed have their own stylesheets
>>>>> that have to manually incorporated into the pages to render
>>>>> appropriately. Instead can we not provide the ability to bundle
>>>>> stylesheets with the component like we bundle javascript? It seems
>>>>> simple to me, but I have missed the boat on a number of occasions
>>>>> in the past so what do you think?
>>>>>
>>>>> -Harish
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Designer's will certainly be responsible for the style either way. My only suggestion is to bundle
the CSS for the component with the component so you don't *have* to specify styles to use the
component, altough you can if you prefer a different style by overriding the one bundled with the
component.
I have the following organization for my stylesheets. Specificity: left(least specific) to
right(most specific).
company level -> project level -> component level -> page level
And I have CSS for every component and every page.
Here I can specify my company level and project level stylesheets in the Border and I can specify
the page level stylesheet in the page spec, but I have no one place to specify the stylesheets for
the components. I have to specify them in each page I use the component which is what I am trying to
avoid.
-Harish
Erik Hatcher wrote:
> Keep in mind one of Tapestry's underlying principals to keep concerns
> separate and let HTML be clean and totally within a designers hands.
> CSS is another layer on top of the *structure* that HTML provides. CSS
> is not something us "coders" are writing... it is really in a layer
> above the structure and very much in the hands of the designers if we
> are fortunate enough to have such artistic people handy on our
> projects. So, we need to tread carefully here to ensure that we make it
> such that designers are allowed to work they need and want work.
>
> And it seems a single master stylesheet is how things are done and
> perhaps one (or more) overriding ones for special sections of a site or
> individual pages, or for different media types. Right?
>
>
>
> On Saturday, December 13, 2003, at 10:50 AM, Harish Krishnaswamy wrote:
>
>> I think that would be against the design intent of CSS. CSS is
>> designed so that the author can provide a style for a page and the
>> user can override it if he/she wishes to do so. Moreover managing a
>> single stylesheet would soon become out of control if all pages use a
>> lot of CSS like mine. Without style, I think, the component would not
>> be complete as it cannot render appropriately. What we need is a way
>> to let the pages override the style provided by the component like
>> Howard suggests and I think CSS takes care of that part. We just have
>> to take care that the order of the CSS links is appropriate.
>>
>> -Harish
>>
>> Erik Hatcher wrote:
>>
>>> It seems to me that one stylesheet is preferable over lots of
>>> separate ones though - so that a designer could alter the styles in
>>> one spot easily. Components should provide the ability to attach a
>>> class or id to pieces of what it renders, though, but I don't think
>>> it is the components job to provide actual styles.
>>> On Friday, December 12, 2003, at 04:33 PM, Harish Krishnaswamy wrote:
>>>
>>>> Hi,
>>>>
>>>> A lot of the components I have developed have their own stylesheets
>>>> that have to manually incorporated into the pages to render
>>>> appropriately. Instead can we not provide the ability to bundle
>>>> stylesheets with the component like we bundle javascript? It seems
>>>> simple to me, but I have missed the boat on a number of occasions in
>>>> the past so what do you think?
>>>>
>>>> -Harish
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
Keep in mind one of Tapestry's underlying principals to keep concerns
separate and let HTML be clean and totally within a designers hands.
CSS is another layer on top of the *structure* that HTML provides. CSS
is not something us "coders" are writing... it is really in a layer
above the structure and very much in the hands of the designers if we
are fortunate enough to have such artistic people handy on our
projects. So, we need to tread carefully here to ensure that we make
it such that designers are allowed to work they need and want work.
And it seems a single master stylesheet is how things are done and
perhaps one (or more) overriding ones for special sections of a site or
individual pages, or for different media types. Right?
On Saturday, December 13, 2003, at 10:50 AM, Harish Krishnaswamy wrote:
> I think that would be against the design intent of CSS. CSS is
> designed so that the author can provide a style for a page and the
> user can override it if he/she wishes to do so. Moreover managing a
> single stylesheet would soon become out of control if all pages use a
> lot of CSS like mine. Without style, I think, the component would not
> be complete as it cannot render appropriately. What we need is a way
> to let the pages override the style provided by the component like
> Howard suggests and I think CSS takes care of that part. We just have
> to take care that the order of the CSS links is appropriate.
>
> -Harish
>
> Erik Hatcher wrote:
>> It seems to me that one stylesheet is preferable over lots of
>> separate ones though - so that a designer could alter the styles in
>> one spot easily. Components should provide the ability to attach a
>> class or id to pieces of what it renders, though, but I don't think
>> it is the components job to provide actual styles.
>> On Friday, December 12, 2003, at 04:33 PM, Harish Krishnaswamy wrote:
>>> Hi,
>>>
>>> A lot of the components I have developed have their own stylesheets
>>> that have to manually incorporated into the pages to render
>>> appropriately. Instead can we not provide the ability to bundle
>>> stylesheets with the component like we bundle javascript? It seems
>>> simple to me, but I have missed the boat on a number of occasions in
>>> the past so what do you think?
>>>
>>> -Harish
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Harish Krishnaswamy <hk...@comcast.net>.
I think that would be against the design intent of CSS. CSS is designed so that the author can
provide a style for a page and the user can override it if he/she wishes to do so. Moreover managing
a single stylesheet would soon become out of control if all pages use a lot of CSS like mine.
Without style, I think, the component would not be complete as it cannot render appropriately. What
we need is a way to let the pages override the style provided by the component like Howard suggests
and I think CSS takes care of that part. We just have to take care that the order of the CSS links
is appropriate.
-Harish
Erik Hatcher wrote:
> It seems to me that one stylesheet is preferable over lots of separate
> ones though - so that a designer could alter the styles in one spot
> easily. Components should provide the ability to attach a class or id
> to pieces of what it renders, though, but I don't think it is the
> components job to provide actual styles.
>
>
>
> On Friday, December 12, 2003, at 04:33 PM, Harish Krishnaswamy wrote:
>
>> Hi,
>>
>> A lot of the components I have developed have their own stylesheets
>> that have to manually incorporated into the pages to render
>> appropriately. Instead can we not provide the ability to bundle
>> stylesheets with the component like we bundle javascript? It seems
>> simple to me, but I have missed the boat on a number of occasions in
>> the past so what do you think?
>>
>> -Harish
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Erik Hatcher <er...@ehatchersolutions.com>.
It seems to me that one stylesheet is preferable over lots of separate
ones though - so that a designer could alter the styles in one spot
easily. Components should provide the ability to attach a class or id
to pieces of what it renders, though, but I don't think it is the
components job to provide actual styles.
On Friday, December 12, 2003, at 04:33 PM, Harish Krishnaswamy wrote:
> Hi,
>
> A lot of the components I have developed have their own stylesheets
> that have to manually incorporated into the pages to render
> appropriately. Instead can we not provide the ability to bundle
> stylesheets with the component like we bundle javascript? It seems
> simple to me, but I have missed the boat on a number of occasions in
> the past so what do you think?
>
> -Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
Re: Components with style
Posted by Harish Krishnaswamy <hk...@comcast.net>.
Quickly glancing at the specs, it seems like the stylesheet belongs in the <head>. Even otherwise, I
think, it would be best for us to control the ordering of the stylesheets if it was all in one
place. So, I think, we probably should let the Shell component be responsible for styles.
-Harish
Howard M. Lewis Ship wrote:
> No, it's a good idea. I have to check where stylesheet data goes ... it may be limited to the <head>
> (instead <html>), in which case we may need the Shell component to be responsible for accumulating
> stylesheet info.
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
>
>>-----Original Message-----
>>From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
>>Sent: Friday, December 12, 2003 4:33 PM
>>To: Tapestry development
>>Subject: Components with style
>>
>>
>>Hi,
>>
>>A lot of the components I have developed have their own
>>stylesheets that have to manually
>>incorporated into the pages to render appropriately. Instead
>>can we not provide the ability to
>>bundle stylesheets with the component like we bundle
>>javascript? It seems simple to me, but I have
>>missed the boat on a number of occasions in the past so what
>>do you think?
>>
>>-Harish
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
RE: Components with style
Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
No, it's a good idea. I have to check where stylesheet data goes ... it may be limited to the <head>
(instead <html>), in which case we may need the Shell component to be responsible for accumulating
stylesheet info.
--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com
> -----Original Message-----
> From: Harish Krishnaswamy [mailto:hkrishnaswamy@comcast.net]
> Sent: Friday, December 12, 2003 4:33 PM
> To: Tapestry development
> Subject: Components with style
>
>
> Hi,
>
> A lot of the components I have developed have their own
> stylesheets that have to manually
> incorporated into the pages to render appropriately. Instead
> can we not provide the ability to
> bundle stylesheets with the component like we bundle
> javascript? It seems simple to me, but I have
> missed the boat on a number of occasions in the past so what
> do you think?
>
> -Harish
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org