Lost css when i send email

hi i use to generate attachment then send them with email with this function
def send_email_with_attachment(doctype, docname, recipients):
attachments = [frappe.attach_print(doctype=doctype, name=docname, print_letterhead=True)]
if attachments and recipients:
frappe.sendmail(recipients = recipients,
cc = recipients,
sender=“”,
subject=docname,
message=“”,
delayed=False,
attachments=attachments
)

why do i loose my css and the images are big and every things i wrong … i works perfect in the website when i generate a pdf or print but the size and bootstrap doesn’t in email ?

i solve it the thing is ,
if you go to frappe.attach_print methode inside frappe app
you will find that it takes the html and style and in that case i open css used in frappe and copy it paste it in the printformat style section and it works just perfect with me