Foundation-sites: small-text-center class does not add text-align: center; in small screen size

Created on 8 Feb 2016  路  8Comments  路  Source: foundation/foundation-sites

When using the small-text-center class, my element does not get the text-align: center; attribute when in a small screen size. However medium-text-center works as described in the doc.

Example code

<div class="row">
    <div class="small-12 medium-2 columns small-text-center">
      <p> Example Text </p>
   </div>
</div>
scss

Most helpful comment

From 5 to 6 we wanted to give responsive classes like this a more precise meaning. So .small-text-center would mean "small screens and up", but since "small screens" also means "any screen 0px wide or larger", .small-text-center is the same as .text-center. Because of that, there are no .small- classes for text alignment.

I'm guessing what you want is "center text only on small", so to do that:

<div class="row">
  <div class="small-12 medium-2 columns text-center medium-text-left">
    <p>Example Text</p>
  </div>
</div>

All 8 comments

From 5 to 6 we wanted to give responsive classes like this a more precise meaning. So .small-text-center would mean "small screens and up", but since "small screens" also means "any screen 0px wide or larger", .small-text-center is the same as .text-center. Because of that, there are no .small- classes for text alignment.

I'm guessing what you want is "center text only on small", so to do that:

<div class="row">
  <div class="small-12 medium-2 columns text-center medium-text-left">
    <p>Example Text</p>
  </div>
</div>

ah sorry overlooked that, makes sense to me now. Sorry about that!

In my case .medium-text-left get's overriden from .text-left - my fault or an known issue?

@fkilian It gets overridden on small screens?

No, in medium up. _alignment.scss renders the class "text-center" after the class "medium-text-left" so it get's overriden. But how can you say text should be centered in small an in all other cases it shoud be aligned left?

@fkilian Not seeing the behavior you describe using this markup:

<div class="row">
  <div class="column text-center medium-text-left">
    <p>This text should be left-aligned on medium screens and up, and center-aligned on small screens.</p>
  </div>
</div>

What's the exact combo of text alignment classes you're using?

Hi,
Why didn't you keep .small-only-text-center ?

Why didn't you keep .small-only-text-center ?

You commented on a very old issue that is already resolved.
Foundation Sites is a mobile first framework. I think this is already removed for a few years.

This is not even available in 6.0.0. See https://github.com/foundation/foundation-sites/blob/v6.0.0/dist/foundation.css

There were probably good reasons for this. You can use the Sass breakpoint functions and reset it on higher breakpoints using medium-text-left and so on.

See https://github.com/foundation/foundation-sites/blob/v6.6.1/dist/css/foundation.css#L777

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anware picture anware  路  3Comments

Jared-Dev picture Jared-Dev  路  3Comments

coachie picture coachie  路  4Comments

Yanchek99 picture Yanchek99  路  4Comments

alexkuc picture alexkuc  路  3Comments