It’s a question that has divided US presidents: is the sitcom Black-ish the best thing on television or, well, racist? For Barack Obama, the show is like watching his own family on screen, while Donald Trump tweeted that the title alone is “racism at highest level”. If it is hard to imagine, say, Mrs Brown’s Boys sparking the same passion, that’s because Black-ish is not your average network comedy.

The programme follows Andre “Dre” Johnson, a wealthy executive, and his family through the usual sitcom misunderstandings, squabbles and moral dilemmas. So far, so Cosby Show. But Black-ish’s creator, Kenya Barris, has made a small tweak that sets the programme on to an altogether more groundbreaking track. Race is not treated as an incidental background detail but part of the show’s identity. The Johnsons are not a family who “happen to be black” but a family who are black. If that doesn’t sound revolutionary, it’s enough to ensure this broad, warm-hearted comedy confronts issues of race, class and culture every week.

While other comedies, from The Fresh Prince Of Bel-Air to A Different World, snuck similar issues into their long runs, the directness of Black-ish’s approach is refreshing, from an episode dealing with police brutality to one finding gentle humour in how long the services in black churches can be. And the ratings and Emmy nominations point to its ability to find quick-fire laughs in both racist stereotypes and Dre’s ability to see them everywhere.

Over the phone from LA, Barris admits that putting race at the centre of a mainstream comedy was a risk. “I was nervous,” he says, but “comedy is a good way to give people a spoonful of sugar with their medicine”. Besides, he never saw an alternative. “I wanted to talk about my family,” he says. “The specific speaks to the universal, and the best story I knew was a family which was absolutely black, living in a world that was changing around them.”

He is not exaggerating about drawing from life. Barris’s wife is a biracial anaesthetist called Bow, just like Black-ish’s matriarch Rainbow, while the real-life couple have six children to the fictional Johnsons’ five. Dre’s central dilemma (which gives the show its name) mirrors Barris’s own anxieties: that by giving his children privileged lives that are so different from his own impoverished childhood, they might lose their cultural heritage.

“I grew up in the ’hood with nothing, in an almost exclusively black neighbourhood,” Barris explains. “My children were growing up in a predominantly white environment; I called them flies in buttermilk. They were black but a little bit ‘less than’ the version of black kids I remember. At the same time their friends – most of whom were white – were a little more black ... I realised youth culture had become a homogenised version of this blended oneness, and I was a bit of a dinosaur.”

Tracee Ellis Ross and Anthony Anderson as Rainbow Johnson and Andre “Dre” Johnson in Black-ish. Photograph: ABC

He says that “90% of the episodes are based on real life”, with one episode lifted straight from his daughter’s phone. “I saw one of her text chains and it was ‘N-word’ this, ‘N-word’ that. I looked at it and said: ‘I don’t think [my daughter’s friend] should be using this word.’

“We got into this huge conversation. I was like: ‘You don’t understand its history and you are letting this white boy say this …’

What followed was a funny but nuanced episode on the politics of the N-word, much to his daughter’s annoyance. “She was like: ‘Dad! [My friend] called me and said: ‘Did you tell your dad I used the N-word?’” he chuckles, clearly unrepentant.

Last month, Tracee Ellis Ross became the first black woman in 34 years to win the Golden Globes’ best actress in a TV comedy or musical for her role as Bow (the last was Debbie Allen for Fame in 1983). The daughter of Diana Ross says the power of Black-ish lies not just in “the magic and beauty of a family which is not always represented” but presenting them as a family like any other. “People say: ‘Oh my God, my kid just did that!’” she says. “It’s not that everyone is getting a sneak peek [at a black family] but everyone is seeing themselves.”

Yet one wonders how Barris balances the demands of black viewers for a show that accurately represents their lives with the wider audience (only a quarter of Black-ish’s audience is black, according to the New Yorker). In fact, he says there is usually more crossover than you might expect. In one episode, for instance, Dre is outraged at not being invited to a neighbour’s pool party, insisting it’s because of the “ugly stereotype that black people can’t swim” (in Dre’s case, of course, it’s true). What follows is a quick history lesson – backed up with archive footage – by Dre on how desegregation led to white flight and urban pools were “defunded, drained and closed”. Afterwards, says Barris, “so many black people were like: ‘I didn’t know that.’”

... Dre takes his family to Disney World. Photograph: Gregg Newton/ABC

Black-ish must have been a gamble for such a major network as ABC, which is owned by Disney. Does it ever balk at some of the more controversial topics? Barris says not, explaining that ABC won the show after a bidding war and a promise not to interfere. So far, he says, only a couple of storylines have worried the execs. One echoed the case of Harvard professor Henry Louis “Skip” Gates, who was arrested while trying to access his own home. With rising tensions over police brutality in Ferguson, the network asked him to drop the idea (Barris agreed to).

But for all Black-ish’s groundbreaking decisions, it still obeys certain sitcom rules: viewers are never left feeling excluded or in despair. A “special” episode on police brutality in season two, for instance, has the Johnsons watching the news to see if a policeman who has killed an unarmed black man will face justice. But rather than focusing on the specifics, it approaches the issue by looking at how to talk to children about difficult news events. In the poignant half-hour that follows, each character offers their viewpoint. Bow wants to tell the children to have faith in the system, while Dre counters that this is selling them a lie. The episode ends with the family attending a rally, and hope overcoming anger.

Black-ish began in September 2014, during the Obama era. “My family got to meet Michelle and Barack,” remembers Barris. “They said it was their favourite show and they watched it as a family. I was like (laughs): ‘Sorry, are you talking to me?’” But part of its strength was relentlessly picking holes in the idea the US was “post-racial”. In fact, Barris says the whole suggestion that by not dwelling on race you could defeat racism, was dangerous. “We are a society which talks less about race than ever – at least openly – because of political correctness and [this has made the situation] worse.”

A scene from Black-ish dealing with media reports of police brutality. Photograph: Patrick Wymore/ABC/Getty

So how will things change under Trump? Anthony Anderson who plays Dre – and who has played golf with the new president socially and has his phone number (which he won’t share) – insists it won’t. “No one is thinking: ‘What political statement can we make today,’” he says.

Still, the actor admits to confronting Trump about his tweet. “Being a politician he didn’t back pedal, he sidestepped,” he reveals.

Black-ish, however, did not sidestep the US election, instead devoting an explosive episode to it. The most powerful scene takes place in Dre’s workplace when one colleague, Lucy, admits to voting for Trump, leaving her co-workers are aghast. Yet Lucy is given a reasonable argument, saying she voted for Obama twice but now “it’s eight years later. My dad’s still out of work. My home town’s about to go under. And Hillary comes out saying she’s basically going to keep everything the same. I’m sorry, but that doesn’t work for me and my family.”

The emotional punch of the show is reserved, however, not for the Trump voters but the bitterness that’s unleashed. When Dre is accused of not being horrified enough about the result, he makes an impassioned speech over the strains of Nina Simone’s Strange Fruit.

How is ABC Television allowed to have a show entitled "Blackish"? Can you imagine the furor of a show, "Whiteish"! Racism at highest level? — Donald J. Trump (@realDonaldTrump) October 1, 2014

“Black people wake up everyday believing that our lives are going to change, even though everything around us says it’s not,” he says. “I’m used to things not going my way. I’m sorry that you’re not and it’s blowing your mind. Excuse me if I get a little offended, because I didn’t see all of this outrage when everything was happening to all of my people since we were stuffed on boats in chains.”

It ends with a plea for unity, which has been widely acclaimed – a relief for Barris.

“I woke up November 9 [the day after the election] and said: ‘I have to write this,’” he explains. “I prayed it wouldn’t happen but I am not surprised that it did. For me, it was so personal.”

After the incendiary start to Trump’s presidency, any call to end divisions might seem naive, but Barris says the aim of Black-ish is simply to open a dialogue. While he laughed off Trump’s tweet (“Him not liking something I did was a compliment, I was like: ‘OK, I am doing something right!’”), he is far from cowed at the idea of writing in this new era.

“I feel renewed inspiration,” he says calmly. “It’s only television but now, more than ever, we have to talk about these things.”

Black-ish returns on Tuesday 28 February, 8.30pm, E4