Based on this answer by Carl Woll, the syntax should be:
Cell[StyleData["Input", StyleDefinitions -> StyleData["Code"]]]
Setting the option programmatically:
SetOptions[
EvaluationNotebook[],
StyleDefinitions -> Notebook[
{
Cell[StyleData[StyleDefinitions -> "Default.nb"]],
Cell[StyleData["Input", StyleDefinitions ->StyleData["Code"]]]> StyleData["Code"]]]
}
]
]
Checking:
As one can see, the input cell is formatted likeas a "Code"
cell, while in its definition it still has the style "Input"
. Done!