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

setting color on Menu.Item has no effect #1583

Closed
marksdean opened this issue Apr 14, 2017 · 3 comments
Closed

setting color on Menu.Item has no effect #1583

marksdean opened this issue Apr 14, 2017 · 3 comments

Comments

@marksdean
Copy link

Please see in the code below (sample code from https://react.semantic-ui.com/collections/menu#menu-example-name-prop).

The 'color' property set on the Menu Item ("reviews") does not work (color not set).


import React, { Component } from 'react'
import { Menu } from 'semantic-ui-react'

export default class MenuExampleNameProp extends Component {
state = {}

handleItemClick = (e, { name }) => this.setState({ activeItem: name })

render() {
const { activeItem } = this.state

return (
  <Menu>
    <Menu.Item
      name='editorials'
      active={activeItem === 'Editorials'}
      onClick={this.handleItemClick}
    />
    <Menu.Item
      name='reviews'
      color='red'
      active={activeItem === 'Reviews'}
      onClick={this.handleItemClick}
    />
    <Menu.Item
      name='upcomingEvents'
      active={activeItem === 'upcomingEvents'}
      onClick={this.handleItemClick}
    />
  </Menu>
)

}
}

@levithomason
Copy link
Member

Color is applied when the items are active, however, the active logic is incorrectly comparing capitalized strings to lowercase strings in this example. Fix is in #1585.

-active={activeItem === 'Editorials'}
+active={activeItem === 'editorials'}

-active={activeItem === 'Reviews'}
+active={activeItem === 'reviews'}

@venkatanarayanan
Copy link

@levithomason why is the color applied only when the item is active

@levithomason
Copy link
Member

That is just how the default them chose to work. You can customize your own theme to your liking. You might also be looking for an inverted menu, where the menu is a solid color.

@Semantic-Org Semantic-Org locked as resolved and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants