Open
Description
The bug
The TCSS property "text-align: left" on a button element causes the button's caption to be aligned to the center instead of to the left.
text-align: right, end and center work as expected, but left or start do the same as center.
MRE
# main.py
from textual.app import App
from textual.screen import Screen
from textual.widgets import Button
class Screen_Button(Screen):
def compose(self):
yield Button('Button1', id='btn_1', variant='primary')
yield Button('Button2', id='btn_2', variant='success')
yield Button('Button3', id='btn_3', variant='error')
class MRE(App):
CSS_PATH = 'style.tcss'
SCREENS = {
'scr_mre' : Screen_Button
}
def on_mount(self) -> None:
self.title = 'Button text-align MRE'
self.push_screen('scr_mre')
if __name__ == '__main__':
app = MRE()
app.run()
/* style.tcss */
Button {
text-align: right;
}
#btn_1 {
text-align: left;
}
#btn_2 {
text-align: center;
}
expected:
actual:
This worked as expected up to and including the 2.1.2 release and broke with the 3.0.0 release.
Metadata
Metadata
Assignees
Labels
No labels