Skip to content
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

Colored text #1885

Closed
piernik opened this issue Feb 27, 2015 · 61 comments
Closed

Colored text #1885

piernik opened this issue Feb 27, 2015 · 61 comments

Comments

@piernik
Copy link

piernik commented Feb 27, 2015

How to get colored text ex class="ui blue text"

@faller
Copy link

faller commented Mar 1, 2015

+1

@jlukic
Copy link
Member

jlukic commented Mar 6, 2015

I understand the desire but I dont plan on adding colored text. I recommend just using css.

@JasonRodman
Copy link

I think this is one place semantic is lacking behind other frameworks. There needs to be some utility classes that we can use to apply common styles to any element without having to write custom css. Styles that have the same meaning no matter what component you apply time to. Some examples are common text color classes, text alignment, font weight classes, etc. I am sure we could think of a few more if need be. I find myself having to extend semantic to support these since I find them extremely useful since I write less css on a daily basis with them. I would urge you to reconsider your position on this. How do you plan to complete with bootstrap and foundation without at least having feature parity with them? These seem like no brainer bare minimum necessities to me.

@ivansglazunov
Copy link

+1
http://materializecss.com/color.html
Nice way to work with color
However, there may be too many CSS.
Why do I need it?
Standard CSS colors are very primitive and are not variable.
In design there is always at least 6, and sometimes 10-15 color states that you need to be able to apply to the background and font. The approach did not materialize so flexible.
I think it would be optimal to make a hybrid of:
Bootstrap
(text|bg)-danger (text-red) (text|bg)-warning (text-yellow) ...
Materialize
(text|bg)-(darken|lighten)-1 (12%) 2 (24%) 3 (36%)

@destan
Copy link

destan commented Oct 9, 2015

👍 colored text is surely a need. Why wouldn't you consider adding it @jlukic ?

Would you merge if somebody make a pr?

@hardy2defy
Copy link

please add some color

@yaboi
Copy link

yaboi commented Nov 12, 2015

+1

2 similar comments
@kevspadillo
Copy link

+1

@chen-ye
Copy link
Contributor

chen-ye commented Nov 14, 2015

+1

@levithomason
Copy link
Member

+1 Colored text of all sorts is extremely common in web apps:
image
image

I'd be hard pressed to find a web app that didn't have simple colored text. Not sure if all the variations are necessary, but at least the basic color palette. Perhaps even a dark/light variation. The variables are all there, they just need classes.

It is quite annoying to have to create an override on every theme you use for this. Worse yet as the lack of these utils encourages developers to use means outside the framework to color text. In turn, you end up with some colors that are now outside the theme's color palette.

Willing to PR this if it would be accepted.

@elldritch
Copy link

👍

1 similar comment
@m0nzderr
Copy link

m0nzderr commented Jan 6, 2016

+1

@Panman82
Copy link

@jlukic I think it's useful so that colors match the theme's / Less colors. Sure, someone could make their own classes, but not having to worry about future color changes is +:100: Please re-consider.

@athyuttamre
Copy link

+1

@stephanecodes
Copy link

+1. It's very annoying. Why is it possible to create a blue button and not a blue text ??

@eeng
Copy link

eeng commented Feb 9, 2016

+1

5 similar comments
@Konard
Copy link

Konard commented Feb 10, 2016

+1

@rpsirois
Copy link

+1

@serusko
Copy link

serusko commented Mar 11, 2016

+1

@FSerg
Copy link

FSerg commented Mar 11, 2016

+1

@yuhr123
Copy link

yuhr123 commented Mar 16, 2016

+1

@joshbodine21
Copy link

+1...I find the need for this all the time and it is annoying to have to manage my own custom CSS just to match colors available in other Semantic-UI components.

@Atokulus
Copy link

+1

2 similar comments
@rolandkofler
Copy link

+1

@brendon
Copy link

brendon commented Apr 1, 2016

+1

@groeney
Copy link

groeney commented Apr 13, 2016

+1 :)

@krtschmr
Copy link

poor. just ridiculous!

@Ryadnov
Copy link

Ryadnov commented Apr 21, 2016

+1

2 similar comments
@CodeAnimal
Copy link

+1

@paper777
Copy link

+1

@tarundhillon
Copy link

+1 please reconsider

@seibelj
Copy link

seibelj commented May 2, 2016

+1

1 similar comment
@frangeris
Copy link

+1

@IonutBajescu
Copy link
Member

Hey chaps, the best method to support a feature request is to use the reactions (there's a thumbs up in the first post - click on it and show your affection).

Posting +1 only lowers the chances of it being implemented as it annoys everyone that's watching the project. (~1k guys so far receive an email everytime someone posts a +1)

Thanks a lot.

@benlesh
Copy link

benlesh commented Jun 7, 2016

Does anyone know if there's already a fork with this feature?

@kamalkhan
Copy link

One could add the following in site/globals/site.overrides

@text-colors: blue, green, orange, pink, purple, red, teal, yellow, black, grey, white;
.text {
    .-(@i: length(@text-colors)) when (@i > 0) {
        @c: extract(@text-colors, @i);
        &.@{c} { color: @@c }
        .-((@i - 1));
    }.-;
}

Which would generate:

.text.white {
  color: #FFFFFF;
}
.text.grey {
  color: #CCCCCC;
}
.text.black {
  color: #1B1C1D;
}
.text.yellow {
  color: #F2C61F;
}
.text.teal {
  color: #00B5AD;
}
.text.red {
  color: #D95C5C;
}
.text.purple {
  color: #564F8A;
}
.text.pink {
  color: #D9499A;
}
.text.orange {
  color: #E07B53;
}
.text.green {
  color: #5BBD72;
}
.text.blue {
  color: #3B83C0;
}

And could be used as:

<span class="red text">I am red!</span>

@bitterloa
Copy link

bitterloa commented Jun 29, 2016

here is a SASS version of the great LESS function that @kamalkhan provided above. after using this I'm kind of leaning towards SemanticUI not providing text colors like this in their build--however since it's such a common use case, it would be great to have a section of the SemanticUI site that had SASS/LESS "recipes" like this where users could add-on as needed:

$text-colors: blue, green, orange, pink, purple, red, teal, yellow, black, grey, white;
@each $tc in $text-colors{
  .text.#{$tc}{
    color: #{$tc};
  }
}

so, the SASS version is much shorter and easier to understand than the LESS version in my opinion...but I don't want to ruffle feathers :-) 💯

@sullyme
Copy link

sullyme commented Jul 12, 2016

I tried UI today and i'ts incredible it doesn't have text colors for span etc...

+1

@brendon
Copy link

brendon commented Jul 12, 2016

Mildly related to this. Is there already a variable with the standard Semantic UI colours in it that we can use when iterating? I couldn't find one myself and wondered why there is so much repetition in the SASS already due to this.

@kamalkhan
Copy link

@brendon The color names in @text-colors: blue, green, orange, pink, purple, red, teal, yellow, black, grey, white; are actual variables in the semantic less variable files. The site/globals/site.overrides file is a good place to extend upon those.

@brendon
Copy link

brendon commented Jul 13, 2016

Thanks @kamalkhan, I should be correct and say LESS rather than SASS :)

I see that the actual colours are defined in Semantic UI (e.g. @blue etc...) but there isn't a list of the colours in a variable (like you provide above) to make it easier to write an extension that iterates over the standard colours in Semantic UI. I guess they're not going to change any time soon, but if they did, this would make things a bit quicker to adjust.

@xDaizu
Copy link

xDaizu commented Jul 22, 2016

Hey, @kamalkhan, nice initiative, but I think it would be best to implement it as

[class*="red text"]

instead of

.red.text

That way you could do something like: <div class="red text black label"> to have a black label with a red text with no chance for ambiguity (would ".text.red" or ".text.black" apply?). Sure, you could make a span, or an i or a div inside the label to put the class="text red"; but I think that to be less powerful.

I could be terribly mistaken, though. It has happened before.

@joshuagruenstein
Copy link

+1

1 similar comment
@hmontes
Copy link

hmontes commented Jul 29, 2016

+1

@asiniy
Copy link

asiniy commented Aug 6, 2016

+1 "D

@brendon
Copy link

brendon commented Aug 7, 2016

Rather than the +1's, use the reactions feature as per: #1885 (comment)

Saves on having to read unnecessary issue emails with +1 in them ;)

@akomm
Copy link

akomm commented Dec 1, 2016

I understand the desire but I dont plan on adding colored text. I recommend just using css.

<sarcasm>
I propose to remove modal and table, instead use css.
I understand the desire for those components, but whatever.
</sarcasm>

@kevinresol
Copy link

kevinresol commented May 10, 2017

I can't understand why headers / colored headers are component while colored content / text / paragraph / whatever-you-call-it is not.

@ivantcholakov
Copy link

+1

colored_text

@rothattack
Copy link

rothattack commented Jul 26, 2017

in SASS you can map the colors if you want to change them:

$text-colors: blue, green, orange, pink, purple, red, teal, yellow, black, grey, white;
$colors: (
	blue: blue,
	green: #03C9A9,
	orange: orange,
	pink: pink,
	purple: purple,
	red: red,
	teal: teal,
	yellow: yellow,
	black: black,
	grey: grey,
	white: white
);
@each $tc in $text-colors{
  [class*="#{$tc} text"] {
    color: map-get($colors, $tc);
  }
}

@each $tc in $text-colors{
  [class*="#{$tc} link"] {
	$color: map-get($colors, $tc);
    color: $color;
    &:hover, &:focus {
    	color: lighten($color, 10%);
    }
  }
}

@akomm
Copy link

akomm commented Jul 27, 2017

@rothattack I think most people here know how to generate classes with sass. As most people know how to implement a modal. But they still use this library. Also: Color schema is part of this library. Why would you want to generate a theme outside and keep it sync manually? You see the point? :)

@denmasyarikin
Copy link

+1

@pbarney
Copy link

pbarney commented Sep 7, 2017

Arbitrarily ignoring rational requests like a petty dictator is a great way to encourage people to start a community-based fork.

Great work on the project @jlukic but the casual dismissal of legitimate requests without so much as a nod is going to alienate you, bud.

@akomm
Copy link

akomm commented Sep 8, 2017

You cant argue on a level of total ignorance: #1885 (comment)

Great work on the project @jlukic but the casual dismissal of legitimate requests without so much as a nod is going to alienate you, bud.

Specifically the highlighted part in quote is the core problem. It makes it look like that: #1885 (comment)

@jlukic: Please, if you have real concerns implementing it or let others implement it, which bother you, share them with the community. The reaction on this issue is great enough, so its worth giving it a proper reply after over 2 years of its existence.

@Semantic-Org Semantic-Org locked and limited conversation to collaborators Sep 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests