Skip to content

Theming: update the utility attributes to use classes #480

Closed

Description

@brandyscarney

URL
https://ionicframework.com/docs/layout/css-utilities

What is missing or inaccurate about the content on this page?
Currently all of our theming documentation for css utilities is using the attribute styles, e.g.:

<ion-col text-center>

This should be updated to use the CSS classes:

<ion-col class="ion-text-center">

screen shot 2019-02-21 at 11 25 35 am

Activity

  1. added
    content
    on Feb 21, 2019
  2. added a commit that references this issue on Feb 21, 2019
    99e6ed9
  3. added a commit that references this issue on Mar 7, 2019
    fc650ec
  4. tmk1991 commented on Mar 7, 2019

    @tmk1991

    Why is this changed proposed? This will break all instances where I have text-center etc. It should be listed as a breaking change on the ionic 4 changelog.

  5. brandyscarney commented on Mar 8, 2019

    @brandyscarney
    MemberAuthor

    @tmk1991 It is not a breaking change. The attributes are still there, this just removes them from the documentation and documents the class versions of the same attributes: https://github.com/ionic-team/ionic/blob/master/core/src/css/text-alignment.scss#L14-L15

    We are removing the attribute documentation in favor of using the classes. As we add more utilities (see display) we will be adding them as classes only. The reason behind moving to classes is because in React, Stencil, or any framework using JSX and TypeScript there will be type errors thrown if you try to use a CSS attribute as it is looking for it to be a property of that element. Rather than have users use CSS attributes for certain frameworks and classes for others, we're recommending classes for consistency as they will work across frameworks without issue. Let me know if you have any questions, thanks!

  6. tmk1991 commented on Mar 8, 2019

    @tmk1991

    So you're keeping the attributes it looks like:

    .ion-text#{$infix}-center, [text#{$infix}-center] { text-align: center !important; }

    I panicked when I went into the docs and saw attributes removed from them.

  7. brandyscarney commented on Mar 8, 2019

    @brandyscarney
    MemberAuthor

    Yes, we won't remove the attributes without a breaking change which requires a major version release (Ionic 5.x) but we are recommending classes for consistency. 🙂

  8. tmk1991 commented on Mar 8, 2019

    @tmk1991

    Thanks @brandyscarney ! - Sorry if my original message came off as inflammatory. I should have investigated it more closely.

  9. brandyscarney commented on Mar 8, 2019

    @brandyscarney
    MemberAuthor

    @tmk1991 No worries! I understand the concern. It's definitely a goal of ours not to introduce any breaking changes moving forward without a major version, so I want to make sure that in cases like this that doesn't happen. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    content

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions