New tag system

skiquel - October 24, 2008 - 06:21
Project:Color.module: Next generation
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:skiquel
Status:closed
Description

    12:03 < dmitrig01|afk> skiquel: {{{Don't touch}}} {{{/Don't touch}}}
    12:03 < dmitrig01|afk> skiquel: just like {{{base}}}
    12:03 < dmitrig01|afk> skiquel: or whatever the notation is
    12:03 < dmitrig01|afk> skiquel: in stylesheets
    12:04 < skiquel> think we can do a /* {{DT!}} */  /* {{/DT!}} */
    12:06 < dmitrig01|afk> skiquel: sure
    12:06 < dmitrig01|afk> skiquel: also, in http://drupal.org/node/301972
    12:06 < Druplicon> http://drupal.org/node/301972 => Fills => 1 IRC mention
    12:07 < dmitrig01|afk> skiquel: the sample images should be wider so you can
                           see what;s going on
    12:07 < dmitrig01|afk> skiquel: like 100-200px
    12:07 < dmitrig01|afk> skiquel: like 100-200px
    12:07 < skiquel> kk
    12:07 < dmitrig01|afk> skiquel: and   'fill' => array(array('y-gradient', 0, 0,
                           2, 114, 'top', 'bottom'),
    12:07 < skiquel> let me github this to the README's todo
    12:07 < dmitrig01|afk> skiquel: the arrya hsould have named keys
    12:08 < dmitrig01|afk> skiquel: fill => array(array(type => y-gradient, x => 0,
                           y => 0, width => 2, height => 2, top color => top,
                           bottom color => bottom))
    13:59 < dmitrig01|afk> skiquel: also program an x gradient

#1

Danial Namousi - October 28, 2008 - 15:39

To be honest, skiquel. I haven't been comfortable with the markup currently used in the CSS-files. I think it's quite messy.

A few weeks back, I did some experiments with alternative markup with corresponding regex for extracting the values (not replacing). The idea was to avoid encapsulating the field value and allow arbitrary CSS values (not just hex codes).

Something like this would be nice to work with:

.example
{
  background-color: #ffffff; /* field-example-background-color */
  background-image: url(images/submenu-hover.png); /* field-example-background-image */
  background-repeat: repeat;
  color: 1px solid black ; /* field-example-color Example note to myself: the border width should be expressed in em */
}

The pattern should allow mashup with other comments as well (as you can see in 'field-example-color').

#2

skiquel - October 29, 2008 - 00:43
Title:Todo: Dmitri reccomendations» Improved tag markup

Danial,

Stuff like this is sometimes better in it's own issue. To begin with I should have had this split up into multiple ones, my bad. This recommendation is good enough to deserve it's own issue. No biggie, I'll just change the title of this. :)

This is looking more practical, how are you with regex? I'm new.

I am guessing we're trying to pull out the attribute name, attribute value, then if applicable the tag behind it. Sound about right?

#3

Danial Namousi - October 30, 2008 - 16:45

Sorry, Tony, my bad.

I am also new to regular expressions but I did manage to pull the corresponding CSS attribute names and values quite easily using the suggested markup. We should perhaps consult someone from the community who's good at this. I could perhaps provide a first draft of the regex for revision.

But a first step might be to, using the current markup, not to draw a line between hexcodes and other types of values, hence treating everything as just text. For the UI, if a field is not a hexcode, farbtastic wouldn't need to act on it, instead a simple text-field could be provided. Does this make any sense? How much work do you think it would take? What could I do to help out?

I could make great use of this in the Sussex theme (http://drupal.org/project/sussex).

#4

skiquel - November 13, 2008 - 23:58
Title:Improved tag markup» New tag system
Status:active» fixed

OK Danial,

Finishing the rewritten tag system.

- New tag system
      Tags are now replaced by having a named tag after the attribute.
       
        Old usage:
          color: /* {{tag}} */#FFFFFF/* {{/tag}} */
         
        New usage:
          color: #FFFFFF; /* t:tag */
         
        Do not use spaces in tags, instead seperate words with -
          Example: body-color-tag

I created another theme called cleanstate_tag that demonstrates its usage.

JohnAlbin: Is there anyway we can use subthemes to slim down the duplicate files we're using?

#5

Danial Namousi - November 17, 2008 - 12:35

That's great, Tony! And the timing is impeccable.

#6

System Message - December 1, 2008 - 12:41
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.