Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Sobota, 28. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  better CSS class-names

phpMyEdit Features     better CSS class-names
Odoslať novú tému   Odpovedať na tému    
 
mats     Založený: 18.02.2005   Príspevky: 2  
Príspevok Zaslal: 2005-02-18 19:23
Návrat hore  Odpovedať s citátom     

phpMyEdit assigns CSS class-names like this:
pme-cell-0-colXpostfix
pme-cell-1-colXpostfix
pme-header-colXpostfix

Now if I want column X to be red I need to set
the background color of three classes, and if
I want all cells to have some property I need
to set the property for 2*<number of columns>
classes.

I have gotten the impression that you can in fact
set several classes per element. The above could then
be written like this:
"pme-cell pme-row-0 pme-colX"
"pme-cell pme-row-1 pme-colX"
"pme-header pme-colX"

This would allow me to specify properties for
column X with a single specification, or for all
cells or for all numeric columns or whatever...

Wouldn't this be much better? Or what did I
misunderstand?

 
nepto     Založený: 06.01.2003   Príspevky: 320   Bydlisko: Phoenix, Arizona (USA)
Príspevok Zaslal: 2005-02-24 16:37
Návrat hore  Odpovedať s citátom     

I'm not sure I understand you request. It is possible to set something like this?

Kód:
<td class="class1" class="class2" ... class="classN">


If so, this is very interesting and maybe we could follow this approach in the phpMyEdit.

_________________
Ondrej Jombik (Nepto)
Visit my homepage , review my recent CV or projects and give me some feedback .
 
funny     Založený: 15.07.2005   Príspevky: 2  
Príspevok Zaslal: 2005-07-16 07:53
Návrat hore  Odpovedať s citátom     

index.php
=>
<html>
<head>
<link rel="stylesheet" type="text/css" href="s.css" />
</head>

<body>

<span class="main first">This is a span</span>
<br /><br />
<p class="main second">This is a p</p>
<br /><br />

</body>
</html>

s.css =>
.main
{
color:#990066;
border: 2px outset #ff0033;
}

.first
{
font-size: 16px;
letter-spacing:5px;
}

.second
{
font-size:12px;
text-decoration:underline;
}
__________________________________
make one big class for what remains unchanged and some small class for what needs to be added for each particular element

 
plemieux     Založený: 11.05.2005   Príspevky: 20  
Príspevok Zaslal: 2005-09-22 12:54
Návrat hore  Odpovedať s citátom     

I achieve this by modifying the four last line of getCSSclass function (line 1168 in v1.167).

Replace:
Kód:
if ($postfix) {
  $elements[] = $postfix;
}
return join($this->css['separator'], $elements);

by:
Kód:
if ($postfix) {
  if (!strpos($postfix,' ') === 0) $postfix = $this->css['separator'].$postfix;
}
return join($this->css['separator'], $elements).$postfix;


Then simply add a space in the config this way:
Kód:
'css' => array('postfix' => ' mandatory')


Of course, if $postfix gets trimmed in future version, this would stop working. You could use a pipe or an underscore. Using a space is just more intuitive (to me at least :) ).

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov