Yeah, your output is what's supposed to occur: Sass thinks you're trying to
nest a class selector, ".center", beneath a "td" selector, and acts
accordingly. However, in trunk, we've added a special character, "&", that
can be used in selectors to literally include the parent selector. So your
code would be:
table.calendar-day
:background #cccccc
td
:font-size .75em
:text-align right
&.center
:text-align center
Hope that helps!
- Nathan
On 3/26/07, Hampton <[EMAIL PROTECTED]> wrote:
>
>
> This is sort of based off the way that CSS works itself.
>
> For this particular instance, I would recommend making a global style
> for .center instead of scoping it.. since its a common thing to use in
> a project. Also, class ".clear" is useful.
>
> But, for this, you have to do the following.
>
> table.calendar-day
> :background #cccccc
> td
> :font-size .75em
> :text-align right
> td.center
> :text-align center
>
> That would work!
>
> -hampton.
>
> On 3/26/07, s.ross <[EMAIL PROTECTED]> wrote:
> >
> > I've written this:
> >
> > table.calendar-day
> > :background #cccccc
> > td
> > :font-size .75em
> > :text-align right
> > .center
> > :text-align center
> >
> > To go against something like:
> >
> > <table class="calendar-day">
> > <tr>
> > <td class="center">
> > this should be centered
> > </td>
> > </tr>
> > </table>
> >
> > The CSS I'm seeing is:
> >
> > table.calendar-day {
> > background: #cccccc; }
> > table.calendar-day td {
> > font-size: .75em;
> > text-align: right; }
> > table.calendar-day td .center {
> > text-align: center; }
> >
> >
> > And what I believe I need to see is:
> >
> > table.calendar-day {
> > background: #cccccc; }
> > table.calendar-day td {
> > font-size: .75em;
> > text-align: right; }
> > table.calendar-day td.center { /* note closed up space between
> > td and .center */
> > text-align: center; }
> >
> > Am I mistaken? Did I write the Sass wrong?
> >
> > Thanks,
> >
> > Steve
> >
> >
> >
> >
> > >
> >
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---