Skip to content

List Style Shorthands #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 14, 2011
Merged

List Style Shorthands #24

merged 2 commits into from
Sep 14, 2011

Conversation

ju1ius
Copy link

@ju1ius ju1ius commented Sep 14, 2011

  • Adds CSSRuleSet::expandListStyleShorthand() and CSSRuleSet::createListStyleShorthand()
  • Reformated code to match the weird coding conventions of the project...;-)

@ju1ius
Copy link
Author

ju1ius commented Sep 14, 2011

For performance reasons, I'm also considering to store the css rule names and keywords lists used in these methods as static properties, like this:

<?php
class CSSRule {
  static
    $LIST_PROPERTIES = array(
      'list-style-type', 'list-style-position', 'list-style-image'
    ),
    $LIST_PROPERTIES_DEFAULTS = array(
      'list-style-type'     => 'disc',
      'list-style-position' => 'outside',
      'list-style-image'    => 'none'
    );
}
class CSSValue {
  static
    $LIST_STYLE_TYPES = array(
      'none', 'disc', 'circle', 'square', 'decimal-leading-zero', 'decimal',
      'lower-roman', 'upper-roman', 'lower-greek', 'lower-alpha', 'lower-latin',
      'upper-alpha', 'upper-latin', 'hebrew', 'armenian', 'georgian', 'cjk-ideographic',
      'hiragana', 'hira-gana-iroha', 'katakana-iroha', 'katakana'   
    ),
    $LIST_STYLE_POSITIONS = array(
      'inside', 'outside'
    );
}

But I'm wondering wether to add them in the corresponding classes or to create separate repository classes in order to avoid cluttering the source code with long lists of keywords.
What do you think ?

sabberworm added a commit that referenced this pull request Sep 14, 2011
@sabberworm sabberworm merged commit 803820f into MyIntervals:master Sep 14, 2011
@sabberworm
Copy link
Collaborator

I’m against creating static “utility” classes. Put the static method/property where it’s most appropriate. I think your examples are perfect the way they are (no nitpicking this time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants