#it probably just doesn't allow hyphenation
Explore tagged Tumblr posts
sins-of-the-sea · 2 years ago
Text
Tumblr media
“Don’t you normally hyphenate your surname when you write it out in the Romanized alphabet, Rashid?”
Tumblr media
“Well....”
Tumblr media Tumblr media
“...Racist Santa.”
5 notes · View notes
girllookingoutwindow · 4 months ago
Note
Do you guys think the Bridgerton women would have kept their last names after marrying?
Back then, it wasn't legalized or common for women to keep their maiden name after marrying, but what if in the Bridgerton universe that women were allowed to?
Eloise would definitely keep her maiden name. That I know for a fact. Kate would have probably decided to hyphenate. She'd either be Kate Sharma-Bridgerton or Kate Bridgerton-Sharma. Daphne wouldn't have kept her maiden name. Violet wouldn't have either. Lady Danbury would have definitely kept her maiden name. Penelope wouldn't have kept her maiden name for obvious reasons. Edwina would have changed her name to Bridgerton as soon as she was married. Francesca wouldn't have kept her maiden name. I am not entirely sure about Hyacinth, but I would like to believe she would have either hyphenated or just took her husband's name.
Hi, that it's a very interesting question. Maybe the people in the fandom who knows more about history accuracy can help about this topic. But I agree. I love the idea of having both names for the majority of them. I agree that Penelope would choose to change it, but not because she doesn't love her family. Just because she wanted to be a Bridgerton for always. She loves what the name represents: love.
so, I think it would depend of how they feel about it and what they want for their life's. Ia agree with your choices. I don't know abou Lady Danbury, I think she associates the name with power. But I'm not sure.
13 notes · View notes
bookwyrminspiration · 21 days ago
Note
how are you finding studying linguistics????? can i ask what kind of stuff you do just bc im wondering if i might pursue it
personally I am having the time of my life
it'll depend what specific path/courses you take, but some of the foundational stuff has been linguistic analysis, grammatical analysis, that kind of thing
what is a language (what is the difference between a language and a dialect), characteristics of human languages (e.g. they're culturally transmitted, evolve, etc.), the components. what is phonology, morphology. learning IPA and the types/characteristics of sounds, how those characteristics impact how language changes (e.g. the omission--elision--of a sound because where it's produced in the mouth makes the word take longer)
what are the components of a word (which segments indicate subject, object, tense, polarity, etc.), what are the rules for where sounds can appear in a language and how do we analyze these things from data sets.
here's some example work:
Tumblr media
This one is analyzing when sounds are allowed to show up in a language (it's simplified for practice). It's from my notes so you don't have the data set I was pulling from (my apologies, if this is confusing I can explain more in depth).
But essentially we'd be given a set of words in a language and certain sounds to look at (the ones at the tops of the columns). Using specific notation we'd mark what contexts those sounds showed up in to figure out when they could appear in this language. Like in english B and P are completely different interchangable sounds, but p and pʰ have rules about which goes where (and are both considered to be p in the cultural conscious. average english speaker doesn't know the p sound in pot and spot are different).
In this set, the first two have identical contexts (boxed in), so they're in contrastive distribution and interchangable. Second and third have a near contrastive, (circled), which is close enough and means the same thing. But if they didn't show up in the same contexts, we'd have to figure out why not, and which one was allowed to show up where (e.g. this sound is used before vowels, this one is used before consonants)
Here's another:
Tumblr media
It's marked up pretty chaotically, but it was practice identifying form meaning correspondence. So I was looking at the words and their meanings and seeing what forms always showed up with what meanings--like '-pa' always showed up when the words were in present tense.
There's also rules about appropriate hyphenation, which we learned. And i'm using proper notation--like 3SG to mean third singular subject. and PST to mean past.
Of course this was also simplified because we're still learning, but I think you get the idea!
Essentially we have been learning how languages fundamentally work--how do they construct meaning, use sounds, change with time. There's also the social aspect. How does language shape society and society shape language. A little sociological. What are the theories and scholarship on that.
this has been a chaotic summary and I'm not super far into my studies, but! hopefully that's given you a bit of an idea. as a language nerd i am LOVING it, so if you're into language as a whole you probably will too. deadass considering going full masters/phd for this
6 notes · View notes
sasubaeuchithot · 2 years ago
Note
If Sasuke and Naruto did get married who would propose? Or would it be more of a “you wanna get married?” “…yeah” thing. Do you think one would change their surname or like hyphenate or something
genuinely another thing ive literally never thought about lmaoooooo
i think naruto would probably have the idea dawn on him WAY too many years in their relationship. like he sees a pair of his friends have a wedding and is like. "OH. SASUKE AND I CAN DO THIS." and it's a completely new thought in his head. it'd be hilarious if he was just blurted out in the middle of their friend's reception "SASUKE. WE SHOULD DO THIS." and then Sakura has to lecture him that "you don't propose at someone else's wedding" but Naruto didn't think of it as a proposal at all and also doesn't understand why that's something you can't do, but is persuaded by her explaining how proposals are supposed to be grand and romantic (which wigs Sasuke out tremendously). but Naruto makes a vow that he's gunna ask Sasuke to marry him in a way that's going to completely wow him, make him absolutely swoon and cry and it's gunna be the most romantic thing ever just you wait Dattebayo Believe It Teme™.
so Sasuke fully knows Naruto is gunna try to propose to him and does everything in his power to make sure it doesnt happen in public in front of fifty million people like how Sakura described. Sasuke has a lot of anxiety about it, refusing to go out together to eat or to the store, hardly even allowing them to go out to even train, of all things.
thankfully Naruto picks up on Sasuke's anxiety. he waits for a night some several months later when all of Sasuke's walls are down- perhaps they just finished an early round of sex, Naruto carries him to the bath to wash up and spends an hour pampering him.
he doesn't ask until Sasuke gets settled into bed. it's spur of the moment, which it turns out Naruto knew he would have to do to actually catch Sasuke off guard.
i think Sasuke would call Naruto "usuratonkatchi" and Naruto would tease Sasuke about how it was taking him forever to actually say "yes" even though he clearly wanted to. it would break the tension even for Sasuke to "hn" out his agreement to get married, which Naruto would make fun of him even more for. sasuke doesn't swoon, of course he doesn't that would be stupid and pointless and it's just marriage anyway why does it matter (he clings onto Naruto practically purring into his chest for the entire night, and spends the rest of the week hardly stepping away from Naruto's side).
i don't think either would change their name. neither of them really understand the semantics of it, and both are too attached to their family names to want to give it up or modify it.
44 notes · View notes
addictedtostorytelling · 1 year ago
Note
Hi!
Hope you are doing well :) Just a fun and silly question ....
How do you think Sara and Grissom would react now if Sara were referred to as Mrs. Grissom?
I think there have only been two scenarios (I could be wrong) this has happened on CSI – in 10x2, Sara refers to herself as Mrs. Grissom, and in 11x13, the Two Mrs. Grissoms – in which both times it was explicitly made clear she kept her last name.
I realize that it’s the 21st century and it’s not uncommon that women keep their surname after marriage so no biggie that Sara, for all (personal and professional) purposes has kept her last name. But the GSR-fan in me was really hoping someone – either by way of humour or not – would refer to Sara as Mrs. Grissom on CSI: Vegas (in front of the hubby) and we get a reaction. (we got a "my husband" and a "my wife" so can't really complain here)
The version of GSR we got in CSI: Vegas was more jovial. They probably would have teased each other about it?
(I mean she could have gone by ‘Sidle-Grissom’, no?)
Thanks for taking the time to share your thoughts!
hi, @renb80s!
good to hear from you again!
so this topic is one that tends to be polarizing in the gsr fandom, with some people really hating the idea of sara taking grissom's last name (even as part of a hyphenate) and some people really liking it/wishing tptb would have gone that route in canon (either in the original series and/or the reboot).
regardless of one's personal feelings on the matter, the facts are these:
as you point out, sara is twice in canon referred to as "mrs. grissom," once in episode 10x02 "ghost town" and once in episode 11x13 "the two mrs. grissoms."
she is also referenced as one of the two titular "mrs. grissoms" of the latter episode in an extratextual sense.
in the first case, she refers to herself that way, albeit in jest.
in the second, she is referred to that way by julia holden.
in both instances, her reaction to being called "mrs. grissom" is to smile widely and blush.
while she does in the former case correct brass's mistaken impression that she has legally taken grissom's name and in the latter case allow her mother-in-law to correct julia holden's mistaken impression that she has taken grissom's name on her behalf, she doesn't, in either instance, appear at all offended by the mistaken impressions themselves. her responses are both very mild.
i'll take things from there after the "keep reading," if you're interested.
__
now.
canon never delves into why sara doesn't legally take grissom's last name.
the choice could be a personal one on her part.
given the attitudes she expresses in episode 06x21 "rashomama" re: women being treated as exchanged property in marriage, she could be opposed to taking her husband's last name after marriage on feminist grounds.
in a similar vein, maybe she feels maintaining her own identity even within the context of her marriage is important and so doesn't want to either give up her name or merge it with grissom's.
alternatively, perhaps on a more intimate note she wants to keep her family name as something of a testament to herself: to prove her legacy is not determined by her family of origin and that she can be a good, just person while still bearing the last name sidle; to show herself and the world her whole lineage isn't cursed/broken (“everything that happens to us—good and bad—is a part of us. it took me a long time to realize that it doesn’t have to define who we are. we get to decide”).
as an aside: i've always found it interesting sara doesn't change her name upon her emancipation from the foster care system. not only might one expect her to change her name because many former foster kids do once they age out (a fact sara herself even remarks upon in episode 07x16 "monster in the box"), but also because one might think, given her feelings about her family and her childhood trauma, she might be eager to get a fresh start under a new identity once she has the chance to. that she sticks with sidle even after she is at liberty to do otherwise is curious. whether she opts to retain her family name for the personal reason detailed above or perhaps only because legally changing her name would be prohibitively expensive for her (particularly as a financially insecure young adult), we're never told. however, the fact that she still bears her father and mother's last name 25+ years on from her father's murder is certainly fascinating.
i wonder if she was ever worried while she worked for the sfpd that someday someone might discover a link between her somewhat unique surname—according to this tracker, there are fewer than 1,000 sidles (spelled sara's way) worldwide—and a particular 1970s marin county homicide case?
more inanely, maybe she opts to stick with sidle because grissom is commonly called by his last name by their close friends/found family, to the extent she feels her being "grissom," as well, would just be too strange/confusing.
maybe she just likes the way her maiden name sounds due to the alliteration.
maybe she doesn't want her initials to be "sag."
maybe grissom (for whatever reason) never actually offers her his last name and she, not wanting to be presumptuous, never asks if she could take it and so just ultimately doesn't.
maybe she reasons since she and grissom aren't planning to have children, there isn't much imperative for them to all have the same name.
maybe she and grissom talk about the matter and make the mutual decision they don't want to take each other's names or hyphenate (for whatever reasons).
of course, the choice also could be more of a practical one for her.
maybe, like many professional women who have earned degrees, published, been awarded accolades, and built their careers under their maiden names, she doesn't want to separate herself from 20+ years of work and accomplishments.
conversely, her surname status may be more a reflection of the circumstances under which she gets married than anything else: under costa rican law, not only do women not automatically assume their husband's names upon marriage, but foreign citizens who get married in costa rica must use the same name that appears on their passports on their marriage certificates. while a foreign citizen who gets married in costa rica can opt to legally change their name in their country of residence once their costa rican marriage license is sent there, that step is 100% optional and is something the person must undertake to do on their own time/at their own expense ex post facto. that so, if grissom and sara have their wedding in costa rica (which i tend to think they do), then it's entirely possible sara ends up remaining a sidle after marriage by default: because that name is the one on her costa rican marriage license, and she doesn't take the time/pay the fees to make an official change stateside. this option may be especially likely if we consider she probably spends very little time in the states as a newlywed before moving immediately to france.
similarly, even if sara and grissom do marry in the us, she may end up a sidle not due to any strong personal feelings about the matter or professional considerations but simply because the process of legally changing one's name is, frankly, a pain in the ass: while in nevada, people can change their names upon marriage simply by making note of their intentions on their marriage certificates, there are still various costs associated with changing over all of one's legal, professional, and financial information to match one's new name, typically to the tune of about $100-$500. the process can also be time consuming/involved, often requiring in-person visits to prove one's identity at the dmv, bank, city hall, etc. figuring out what all you have to change and what documentation you need in order to make said changes can be confusing/laborious. maybe sara, after initially mulling changing her name, considers the time, expense, and effort required of the endeavor and simply says, "to hell with it," figuring since most people in her life would still know her as sara sidle anyhow, it isn't worth her while to jump through all those obnoxious hoops.
case in point: my mother, who has been married to my father and had his name for forty years, only recently discovered she apparently never changed over her social security number from her maiden name. the process of getting it changed over required dozens of phone calls and filings on her part (made difficult as, four decades on, she doesn't have much documentation linking her to her maiden name left to use for verification purposes) and took her several weeks to complete.
alternatively, maybe sara does initially intend to change her name and is maybe even in the process of doing so but never actually gets around to finishing the job due to the fact that, as a newlywed, she is so frequently in and out of the country, is extremely busy, (once she gets back to the states) works night hours, etc., etc.
maybe there is a paperwork glitch that makes the process difficult enough she doesn't elect to push the issue, even if perhaps she had initially been interested in taking grissom's name to start out with.
as a former ward of the state of california, she would not have access to her original birth certificate and was likely issued a new social security number when her mother's parental rights were severed. though she in theory has a redacted birth certificate and new ssn that are valid for legal purposes, maybe when, after her costa rican wedding, she goes to the state of nevada with her redacted/reissued documents looking to file her legal name change, they give her a hard time about them because they look funny ("how come your birth certificate says you were born in 1971 but according to this database your ssn was issued in 1980?") and require additional verification she simply cannot be bothered to provide.
it's also worth noting that while she doesn't legally take grissom's name either the first time she's married to him or the second (at least insofar as we know), her reasons for making that choice may be different in marriage 1.0 vs. marriage 2.0—for example, maybe the first go-around, she doesn't change her name due to the whole "we got married in costa rica" thing, whereas the second, she figures that after a 25+ year career, she wants to maintain the same name she built her reputation on.
of course, without knowing sara's exact reason or reasons for keeping her maiden name, we can't say with 100% certainty what her feelings on the matter of being "mrs. grissom" are—whether or not it's an issue she has strong feelings about, one way or another; if it's a decision she intends to stick with forever or if she ever might consider changing her name to grissom eventually; etc.
however, based on the two reactions to people referring to her that way we see in canon, i think, at the very least, we can infer she isn't adamantly opposed to being called mrs. grissom socially, even if she didn't take his name legally—and, indeed, may even be somewhat tickled by the experience, finding the notion amusing, if not even cute.
that so, i tend to imagine if someone were to refer to her as mrs. grissom or sara grissom during the events of the reboot, she would probably react much in the same way we see her do in s10 and s11: she'd get a big smile on her face, fluster a bit, and look to grissom, if he were with her. then, either she or he would, laughingly, point out she hadn't changed her name (at least not legally). maybe there'd be some playful banter about why she hadn't ("eh, i thought about it, but living in international waters? it would be a pain to file" "just say the words, and i'll take you to the consulate's office next time we're in guam, darlin'").
my take—and, full disclosure, i'm in the camp that doesn't mind the idea of her changing her name or even just going by grissom's surname more informally/on occasion (as is probably obvious from the fact that i often label my gsr gifsets as "the grissoms")—is that while she's never made the effort to actually legally change her name to grissom's and maybe even sees some advantages to keeping her maiden name for professional reasons, she has no problem being associated with his name socially and in fact kind of gets a kick out of it, which is why she sometimes refers to herself that way unprompted and doesn't really go out of her way to correct people who make mistakes about what she's called.
i can very easily imagine that after sara and grissom leave vegas at the end of csi: vegas s1, a few weeks later, a postcard arrives at the lab addressed to max, postmarked from panama, bearing no inscription other than a signoff "from the grissoms," written in sara's hand.
thanks for the question! please feel welcome to send another any time.
also, shameless plug: for those of you reading "an opposite of echoes," eventually, you'll get to see sara react to being called "mrs. grissom" in that story (on multiple occasions).
15 notes · View notes
arizonaconservativegal · 10 months ago
Note
For the fact that Bruce Jenner is a man with reproductive sexual organs of man same as me and how the fuck does that make him different than any other man? when in fact he is a man. How the fuck do you think he is woman just like yourself a natural born female? If you think he is a women how come he cannot get periods or goes through what a woman´s body goes through and if younger how would that man get pregnant? like to hear your leftists logic on men like him who think he is a woman.
Here's the thing about Caitlyn Jenner
Obviously she is biologically male. Obviously she is not the same as a biological woman. She's also not trying to tell anyone that she gets pms or should be allowed to compete against women in sports (quite the opposite of that, in fact). As far as I can tell, she's just trying to live as normal a life as someone like her is able but she's under no illusions that she will ever be quite the same and she's not trying to change the rest of us to make herself feel more normal.
I'm totally fine with this. She's not bothering me. She's not doing anything that affects anyone else.
So yeah I'm going to call her Caitlyn and refer to her as 'she' and all that. She hasn't gone by Bruce in ten years. My friend just got married and took her husband's last name. That doesn't make her biologically a Smith. But she's part of the family now so we're going to call her Smith. Caitlyn Jenner is not biologically a woman but as far as I'm concerned, refusing to acknowledge that she is living the way the rest of us do is just as silly as refusing to call my friend by her new last name. I can think it's a little weird, just like I'd think it was a little weird if my friend had decided to hyphenate her last name instead of just going with Smith, but so what?
I don't care what adults want to do with their own body and what they want to call themselves. I only care when they start to impose on others.
As far as all the other trans stuff goes...
I think there are a lot of kids who would have been goth or emo when I was growing up but these days are being told that they are probably trans or whatever. They just feel out of place and are searching for something that makes them feel understood. And while I don't really see the harm in letting them buy some new clothes and cut their hair a certain way to see if they feel better, there is no good reason for any medical procedures to be performed on them. I think there are a lot of well intentioned but misguided people trying to help them and I think there are a lot of sick fucks trying to take advantage for politics or profit.
I think there are also a lot more sick fucks who like to pretend to be trans whenever it's convenient and gives them access to someone they can prey upon. But let's just be adults here for a second - I'm pretty sure we can all tell the difference between someone like Caitlyn Jenner and some creep that just got convicted of raping four women and has decided suddenly that he would like to serve his sentence in the women's prison. Come on.
Locker rooms, bathrooms, and prisons are sex segregated for a reason and should stay that way. I would be perfectly happy to see some more gender neutral locker rooms and bathrooms in addition to the women's and men's rooms - but I am vehemently opposed to making either one of those the new gender neutral space.
I am not going to entertain the idea that transwomen are identical to the rest of us. Sports are sex segregated for a reason as well. I don't really know what would be fair to trans athletes but I know for sure that making the women's team the 'everyone team' is not fair to anyone. Anyone pushing that is just willfully blinded by politics.
I am not going to refer to mothers as 'birthing people' or gynecology patients as 'people with vaginas' or any of that nonsense. I am also not going to say 'people with two legs' to be sensitive to people who have fewer. We all know what we're talking about and if you are offended by your own differences, then I'm sorry but that's not something some sparkly new language is going to fix for you. I'm certainly not going to entertain the idea of changing the definition of 'woman.' I'm not going change how I refer to myself to appease anyone else. I will call you whatever name you want but you don't get to redefine who I am.
And if you pick a really stupid name or fake pronoun for yourself, don't be shocked when someone makes fun of it the way we all make fun of Xitter or some millennial naming her kid MacKeighleigh.
But here's the other thing about Caitlyn Jenner - she is not any of those people. Actually I don't think most trans people are any of those people. I think almost all of that garbage comes from people who are misappropriating the label or who fancy themselves activists and they're giving the actual trans community a bad rap. I think most trans people are pretty normal aside from the obvious.
We have a handful of legitimate issues to work out in regards to the bathrooms and sports and I'm sure that is a little uncomfortable to have to hash out but I think if we stop trying to be assholes on purpose, we can figure it out.
8 notes · View notes
rametarin · 8 months ago
Text
That's just the problem. If you think about it, if you stop and think about how being 'queer' is treated, discussed, spoken about, as a political entity and social movement rather than simply a characteristic like blood type or hair color, then it suddenly makes perfect sense. It is the ideology itself that is producing this effect. It was always intended to produce this effect, that's why it's a social rallying call to engage in the public arena on these values.
To the activist, "queer" doesn't represent something that will eventually just be normal. Because, normal to them is queer people being identified as the political concept of Oppressed. By whom? Society and the majority. Okay, how?... The recursive absolutist belief that, unless you are in a socialist society that is both government and culture, then oppression stems from that. They will accept no substitutes and no alternatives. To them, society must be living by the rest of the logic used to platform and fascillitate the language used as a hydrofoil for LGBT rights, and that means applying the rest of it to the universe, without exception.
And so, there is no "normalization" the way there is in regular liberalism minus the Marxist views of demographic as class as political entity. There is no resolution. There is no alleviation from oppression. There are only these arbitrary absolutist relationships between groups they've deemed "oppressed" and "oppressor" as a form of convenience in very black and white thinking, and what that means.
This is how and why that particular flavor of gay rights, that particular flavor of "anti-racism," tthat particular flavor of what dares call itself, "sexual equality," is bunk and bullshit. It doesn't live in reality, it lives in a platonic ideal model and then chides the universe for not fitting that mold and molecular outline exactly.
In that ideology, to be trans is to truly and without exception become the gender that which you aspire to be. They insist, without exception, that there is no hyphen, there is no honorary, there is no distinguishing or distinctive difference and so language beyond the occasionally convenient, "he's cis" or "he's trans" is strictly verboten. You are not even allowed to distinguish it for practical reasons separate from ideological ones, because to them, ideology is literally everything- IT inerprets the world and how it works, and aught to work, and woe be to anyone that dares say we should form our linguistic culture off of things detatched from the manufactured pretext that social movement gives it. And so, if this is true, then to be a transman makes you just as much of an oppressive, horrifying monster as a cisgendered man to those that believe this view.
So as a transman, if you're lucky enough to pass and the knee-jerk reaction to you be rejection of you as a human being, but be perceived as the, "violent, monstrous, exploitative and cruel" overlord oppressor class, well, congratulations. You don't need to do anything- you don't need to have negative intentions- you don't need to personally be guilty of anything to be the ideological opponent of all "right and correct thinking people."
Any word you say that is, "out of class?" Best watch your back, or else Right Correct Thinking People, ie, the Anticapitalist, Progressive People, will be sure to check you for not having the credentials to speak vs. "the oppressed." Only, they'll probably call them minorities, as then you have to argue you, as a man, should get to disagree with the holy oppressed group and have your opinion, as a filthy oppressor man be worth anything.
Unless you do the modern equivalent of that thing we did in the 80s when we were loudly told our opinions on any racial or ethnic affair were invalid because we were not a member of that group, even if what they did on the basis of race-as-group affected the rest of society: The queer version of the, "I'm actually 1/32 Cherokee." thing. Wave your credentials as a member of the "Queer," and thus, safe demographic that's allowed to have credibility in your opinion and welcoming to the movement, just so people know, you're safe, you're actually one of the rarer and more oppressed colors of the rainbow, you can speak and nobody that's cis or het has any right to even question you, and they aren't allowed to be belligerent or contradict you without becoming subject to those in-ideology rules that say they're now oppressing a transman's lived experience. Suddenly make that trans-man prefix matter, so you aren't treated like a bigoted, monstrous fratboy or bloviating old money Southern Evangelical Doug Dimmadome son and causer of the anti-woman society that somehow is responsible for teaching horrible men to commit sexual assault on the oppressed women and thus lower the bar of expected gender relations too deep for you as an individual to ever lift to normalcy again. Wear that rainbow and identifying trans flag the way cheetah cubs wear honey badger fur colors to confuse predators. Or else, you'll finally pass as what they consider in their political ideology to be A Man, and get mistaken for how they see all men. How they treat all men. How they speak to all men.
Does it feel cold to be among that hideous political school of thought that dares to call itself what "progressive" means, now? Like they're blaming you for things you never had anything to do with, based on what they consider inherently to be a choice and not a fixed and natural state? Like you're being treated like a member of a mafia, regardless of your level of participation in "cisheteronormativity" (just, not being queer and not making queerness a factor) or like a male chauvinist just by being a man, no matter how far removed from misogyny your actions, views and countenance are?
Welcome to the club, kid. This is how things really are.
Tumblr media
Get ready to never have your opinion or thoughts, much less your heart and soul, ever matter to these "Progressives" again, unless you emphasize how queer you are to make it matter. Get ready for ther ideology to misinterpret your every action and thought and feeling and have them argue with you that you can't be right, because Men In This Society Do Things For These Following Reasons.
tried to vent in a trans space about how, as a trans man who’s been on T for a long time (over 7 years now), i have noticed that the more i pass as a man, the less welcomed i am in queer spaces unless i go out of my way to feminize myself. and how that sucks! and it’s isolating!!! and it feels horrible to see ppl who used to like you and be close to you drift further and further the more masculine (& therefore more comfortable in urself) u become…
only to get ppl replying to me and saying “well if you dressed more fem then ppl wouldn’t be intimidated by you. you signed up for this”
i’m sorry but i didnt sign up for social isolation when i transitioned, i signed up for gender euphoria and comfort in myself and my life. and i had hoped that the ppl in my life would be able to see how much joy that brings me and continue to love me.
80K notes · View notes
emocka · 2 years ago
Text
Lines about y/n and how the guys admire her
Aether: y/n is a great person and I love her. How they manage everyday life while blind amazes me...what do you mean? She asking why I choose her out of everyone else to date? She beautiful fun and I feel the need to protect her....I don't know when ill pop the question...no! It'll be a private one!
Xiao: she annoying...im aware were married still annoying. Im impressed that she doesn't let her disability stop her from fighting....her Phoenix form is nice.....what? I don't know what your talking about. She can get around by herself just fine. If she can throw a book at someone bothering her she fine. No need for me to guide her around. She the same age as me.
Kazuha: she's wonderful. The fact that she manages to take in account of her condition makes her a great person....yes she still recovering from the attack....oh you mean the kitsune made of anemo? I don't mind it but it does take away quality time when if guides her around...oh here she comes.
Gorou: I love her for everything she does. Yea we fought in the past but things have changed....what? She has adeptus blood that why she has the cats ears? So what?...who told you that? Fine yes it true I wrap my tail around her waist when we walk around watasumi Island on dates. Besides I don't want her walking off places. She still adjust to her condition and doing the best she can.
Ayato: that sly little princess of mine you say? How does she pull her prank while blind? Well she has enhanced hearing and a great sense of smell....how was she able to enjoy the wedding? How did she find the right kimono? My sister helped find one as for the first question it was a small one before the decree was issued we only invited ten people to watch us exchange our vows....hm? How does she manage to use her polearm? I don't know but archon knows I don't want to be on the other end of her and that weapon.
Scaramouche: I don't know how she managed to set the building on fire but I grew to respect her after that....no I still won't show her around. Tartaglia lies i never walked around with her and she never took my hat.....ok fine it was a one time thing....who told you?!! We don't sleep in the same bed!...I don't know how she manages the claymore while blind and I do not care to know.
Diluc: she a fine wife and I love her....how does she know what stage the baby is in? The nuns make a model and she is able to touch it....oh you mean the colorless vision she has on the necklace. Its a old friends who died protecting her. They were able to keep her safe but lost their life doing it.....yes she still beats herself up over that....yea it was small but they should have been able to guess we were married. She did take my last name and hyphen it with hers...yes I let her keep her last name.
Childe: I don't know how she does it while blind but she kicked my butt several times already. Yea I was their when she got her vision. Randomly fell on her head knocking her out in the process....oh the catalyst she uses? That a one of a kind. No one can replicate it. It a old family weapon passed down. Her family specialized in the stars so she always fight with the zodiac constellations when in battle. Ooooh I wanna see if I can beat her this time!!! And she not allowed to use the Aquarius constellation!! HEY Y/N FIGHT ME!!
Zhongli: ah y/n she been around since the seven rose to victory.She earned the right to be call the queen of the flowers....hm? How does she manage to wield the bow? I wonder too but it probably best i don't know. Yes she was involved in the war 500 years ago. She was the only one who could protect the children in the woods that day. She was also the one who took care of the fallen and heal with wounded...yes she has ridden my dragon form....what her form? I believe its a crystalfly.....oh its not? Oh its a crane. I haven't see her crane from in a long time....oh I suspect her family has always had the ability to take on the form of animals.
Itto: oh y/n? I don't know how she does it but she s great fighter? N-no! I do not love her....ok so maybe I'm a big dummy for an oni but yes I fell in love.
Kaeya: oh your asking how she got her vision even though she can't see? She was very determined to prove people wrong and mastered the sword. I was there when it showed up in her hands....I call her firefly because her vision glows so brightly it looks like a red firefly.
Albedo: y/n? She very beautiful. I have offered her to find a cure for her condition but she said no....oh you mean the beast that follows her? I drew that and brought it to life....why? She still learning how to wield the catalyst. It helps guide her around and defend her....love? So that what I feel when I see her....oh? She's coming?
11 notes · View notes
suzanneshannon · 6 years ago
Text
An Introduction and Guide to the CSS Object Model (CSSOM)
If you've been writing JavaScript for some time now, it's almost certain you've written some scripts dealing with the Document Object Model (DOM). DOM scripting takes advantage of the fact that a web page opens up a set of APIs (or interfaces) so you can manipulate and otherwise deal with elements on a page.
But there's another object model you might want to become more familiar with: The CSS Object Model (CSSOM). Likely you've already used it but didn't necessarily realize it.
In this guide, I'm going to go through many of the most important features of the CSSOM, starting with stuff that's more commonly known, then moving on to some more obscure, but practical, features.
What is the CSSOM?
According to MDN:
The CSS Object Model is a set of APIs allowing the manipulation of CSS from JavaScript. It is much like the DOM, but for the CSS rather than the HTML. It allows users to read and modify CSS style dynamically.
MDN's info is based on the official W3C CSSOM specification. That W3C document is a somewhat decent way to get familiar with what's possible with the CSSOM, but it's a complete disaster for anyone looking for some practical coding examples that put the CSSOM APIs into action.
MDN is much better, but still largely lacking in certain areas. So for this post, I've tried to do my best to create useful code examples and demos of these interfaces in use, so you can see the possibilities and mess around with the live code.
As mentioned, the post starts with stuff that's already familiar to most front-end developers. These common features are usually lumped in with DOM scripting, but they are technically part of the larger group of interfaces available via the CSSOM (though they do cross over into the DOM as well).
Inline Styles via element.style
The most basic way you can manipulate or access CSS properties and values using JavaScript is via the style object, or property, which is available on all HTML elements. Here's an example:
document.body.style.background = 'lightblue';
Most of you have probably seen or used that syntax before. I can add to or change the CSS for any object on the page using that same format: element.style.propertyName.
In that example, I'm changing the value of the background property to lightblue. Of course, background is shorthand. What if I want to change the background-color property? For any hyphenated property, just convert the property name to camel case:
document.body.style.backgroundColor = 'lightblue';
In most cases, a single-word property would be accessed in this way by the single equivalent word in lowercase, while hyphenated properties are represented in camel case. The one exception to this is when using the float property. Because float is a reserved word in JavaScript, you need to use cssFloat (or styleFloat if you're supporting IE8 and earlier). This is similar to the HTML for attribute being referenced as htmlFor when using something like getAttribute().
Here's a demo that uses the style property to allow the user to change the background color of the current page:
See the Pen Using the style Object to Change the Background Color by Louis Lazaris (@impressivewebs) on CodePen.
So that's an easy way to define a CSS property and value using JavaScript. But there's one huge caveat to using the style property in this way: This will only apply to inline styles on the element.
This becomes clear when you use the style property to read CSS:
document.body.style.backgroundColor = 'lightblue'; console.log(document.body.style.backgroundColor); // "lightblue"
In the example above, I'm defining an inline style on the <body> element, then I'm logging that same style to the console. That's fine. But if I try to read another property on that element, it will return nothing — unless I've previously defined an inline style for that element in my CSS or elsewhere in my JavaScript. For example:
console.log(document.body.style.color); // Returns nothing if inline style doesn't exist
This would return nothing even if there was an external stylesheet that defined the color property on the <body> element, as in the following CodePen:
See the Pen element.style Reads Only Inline Styles by Louis Lazaris (@impressivewebs) on CodePen.
Using element.style is the simplest and most common way to add styles to elements via JavaScript. But as you can see, this clearly has some significant limitations, so let's look at some more useful techniques for reading and manipulating styles with JavaScript.
Getting Computed Styles
You can read the computed CSS value for any CSS property on an element by using the window.getComputedStyle() method:
window.getComputedStyle(document.body).background; // "rgba(0, 0, 0, 0) none repeat scroll 0% 0% / auto padding-box border-box"
Well, that's an interesting result. In a way, window.getComputedStyle() is the style property's overly-benevolent twin. While the style property gives you far too little information about the actual styles on an element, window.getComputedStyle() can sometimes give you too much.
See the Pen The getComputedStyle() Method Can Read any CSS Property by Louis Lazaris (@impressivewebs) on CodePen.
In the example above, the background property of the <body> element was defined using a single value. But the getComputedStyle() method returns all values contained in background shorthand. The ones not explicitly defined in the CSS will return the initial (or default) values for those properties.
This means, for any shorthand property, window.getComputedStyle() will return all the initial values, even if none of them is defined in the CSS:
See the Pen window.getComputedStyle() Returns All Longhand Values for a Shorthand Property by Louis Lazaris (@impressivewebs) on CodePen.
Similarly, for properties like width and height, it will reveal the computed dimensions of the element, regardless of whether those values were specifically defined anywhere in the CSS, as the following interactive demo shows:
See the Pen window.getComputedStyle() Returns Width and Height Values Even if Not Defined in the CSS by Louis Lazaris (@impressivewebs) on CodePen.
Try resizing the parent element in the above demo to see the results. This is somewhat comparable to reading the value of window.innerWidth, except this is the computed CSS for the specified property on the specified element and not just a general window or viewport measurement.
There are a few different ways to access properties using window.getComputedStyle(). I've already demonstrated one way, which uses dot-notation to add the camel-cased property name to the end of the method. You can see three different ways to do it in the following code:
// dot notation, same as above window.getComputedStyle(el).backgroundColor; // square bracket notation window.getComputedStyle(el)['background-color']; // using getPropertyValue() window.getComputedStyle(el).getPropertyValue('background-color');
The first line uses the same format as in the previous demo. The second line is using square bracket notation, a common JavaScript alternative to dot notation. This format is not recommended and code linters will warn about it. The third example uses the getPropertyValue() method.
The first example requires the use of camel casing (although in this case both float and cssFloat would work) while the next two access the property via the same syntax as that used in CSS (with hyphens, often called "kebab case").
Here's the same demo as the previous, but this time using getPropertyValue() to access the widths of the two elements:
See the Pen Using window.getComputedStyle() along with getPropertyValue() by Louis Lazaris (@impressivewebs) on CodePen.
Getting Computed Styles of Pseudo-Elements
One little-known tidbit about window.getComputedStyle() is the fact that it allows you to retrieve style information on pseudo-elements. You'll often see a window.getComputedStyle() declaration like this:
window.getComputedStyle(document.body, null).width;
Notice the second argument, null, passed into the method. Firefox prior to version 4 required a second argument, which is why you might see it used in legacy code or by those accustomed to including it. But it's not required in any browser currently in use.
That second optional parameter is what allows me to specify that I'm accessing the computed CSS of a pseudo-element. Consider the following CSS:
.box::before { content: 'Example'; display: block; width: 50px; }
Here I'm adding a ::before pseudo-element inside the .box element. With the following JavaScript, I can access the computed styles for that pseudo-element:
let box = document.querySelector('.box'); window.getComputedStyle(box, '::before').width; // "50px"
See the Pen Using getComputedStyle() to get styles from a pseudo-element by Louis Lazaris (@impressivewebs) on CodePen.
You can also do this for other pseudo-elements like ::first-line, as in the following code and demo:
let p = document.querySelector('.box p'); window.getComputedStyle(p, '::first-line').color;
See the Pen Using getComputedStyle() to get styles from a pseudo-element by Louis Lazaris (@impressivewebs) on CodePen.
And here's another example using the ::placeholder pseudo-element, which apples to <input> elements:
let input = document.querySelector('input'); window.getComputedStyle(input, '::placeholder').color
See the Pen Using getComputedStyle() to get styles from a ::placeholder pseudo-element by Louis Lazaris (@impressivewebs) on CodePen.
The above works in the latest Firefox, but not in Chrome or Edge (I've filed a bug report for Chrome).
It should also be noted that browsers have different results when trying to access styles for a non-existent (but valid) pseudo-element compared to a pseudo-element that the browser doesn't support at all (like a made up ::banana pseudo-element). You can try this out in various browsers using the following demo:
See the Pen Testing getComputedStyle() on non-existent pseudo-elements by Louis Lazaris (@impressivewebs) on CodePen.
As a side point to this section, there is a Firefox-only method called getDefaultComputedStyle() that is not part of the spec and likely never will be.
The CSSStyleDeclaration API
Earlier when I showed you how to access properties via the style object or using getComputedStyle(), in both cases those techniques were exposing the CSSStyleDeclaration interface.
In other words, both of the following lines will return a CSSStyleDeclaration object on the document's body element:
document.body.style; window.getComputedStyle(document.body);
In the following screenshot you can see what the console produces for each of these lines:
Tumblr media
In the case of getComputedStyle(), the values are read-only. In the case of element.style, getting and setting the values is possible but, as mentioned earlier, these will only affect the document's inline styles.
setProperty(), getPropertyValue(), and item()
Once you've exposed a CSSStyleDeclaration object in one of the above ways, you have access to a number of useful methods to read or manipulate the values. Again, the values are read-only in the case of getComputedStyle(), but when used via the style property, some methods are available for both getting and setting.
Consider the following code and demo:
let box = document.querySelector('.box'); box.style.setProperty('color', 'orange'); box.style.setProperty('font-family', 'Georgia, serif'); op.innerHTML = box.style.getPropertyValue('color'); op2.innerHTML = `${box.style.item(0)}, ${box.style.item(1)}`;
See the Pen Using Three Different Methods of the CSSStyleDeclaration API by Louis Lazaris (@impressivewebs) on CodePen.
In this example, I'm using three different methods of the style object:
The setProperty() method. This takes two arguments, each a string: The property (in regular CSS notation) and the value you wish to assign to the property.
The getPropertyValue() method. This takes a single argument: The property whose value you want to obtain. This method was used in a previous example using getComputedStyle(), which, as mentioned, likewise exposes a CSSStyleDeclaration object.
The item() method. This takes a single argument, which is a positive integer representing the index of the property you want to access. The return value is the property name at that index.
Keep in mind that in my simple example above, there are only two styles added to the element's inline CSS. This means that if I were to access item(2), the return value would be an empty string. I'd get the same result if I used getPropertyValue() to access a property that isn't set in that element's inline styles.
Using removeProperty()
In addition to the three methods mentioned above, there are two others exposed on a CSSStyleDeclaration object. In the following code and demo, I'm using the removeProperty() method:
box.style.setProperty('font-size', '1.5em'); box.style.item(0) // "font-size" document.body.style.removeProperty('font-size'); document.body.style.item(0); // ""
See the Pen Using the removeProperty() method of the CSSSTyleDeclaration API by Louis Lazaris (@impressivewebs) on CodePen.
In this case, after I set font-size using setProperty(), I log the property name to ensure it's there. The demo then includes a button that, when clicked, will remove the property using removeProperty().
In the case of setProperty() and removeProperty(), the property name that you pass in is hyphenated (the same format as in your stylesheet), rather than camel-cased. This might seem confusing at first, but the value passed in is a string in this example, so it makes sense.
Getting and Setting a Property's Priority
Finally, here's an interesting feature that I discovered while researching this article: The getPropertyPriority() method, demonstrated with the code and CodePen below:
box.style.setProperty('font-family', 'Georgia, serif', 'important'); box.style.setProperty('font-size', '1.5em'); box.style.getPropertyPriority('font-family'); // important op2.innerHTML = box.style.getPropertyPriority('font-size'); // ""
See the Pen Using getPropertyPriority() to get a property's "importance" by Louis Lazaris (@impressivewebs) on CodePen.
In the first line of that code, you can see I'm using the setProperty() method, as I did before. However, notice I've included a third argument. The third argument is an optional string that defines whether you want the property to have the !important keyword attached to it.
After I set the property with !important, I use the getPropertyPriority() method to check that property's priority. If you want the property to not have importance, you can omit the third argument, use the keyword undefined, or include the third argument as an empty string.
And I should emphasize here that these methods would work in conjunction with any inline styles already placed directly in the HTML on an element's style attribute.
So if I had the following HTML:
<div class="box" style="border: solid 1px red !important;">
I could use any of the methods discussed in this section to read or otherwise manipulate that style. And it should be noted here that since I used a shorthand property for this inline style and set it to !important, all of the longhand properties that make up that shorthand will return a priority of important when using getPropertyPriority(). See the code and demo below:
// These all return "important" box.style.getPropertyPriority('border')); box.style.getPropertyPriority('border-top-width')); box.style.getPropertyPriority('border-bottom-width')); box.style.getPropertyPriority('border-color')); box.style.getPropertyPriority('border-style'));
See the Pen Using getPropertyPriority() to check the priority of longhand properties by Louis Lazaris (@impressivewebs) on CodePen.
In the demo, even though I explicitly set only the border property in the style attribute, all the associated longhand properties that make up border will also return a value of important.
The CSSStyleSheet Interface
So far, much of what I've considered deals with inline styles (which often aren't that useful) and computed styles (which are useful, but are often too specific).
A much more useful API that allows you to retrieve a stylesheet that has readable and writable values, and not just for inline styles, is the CSSStyleSheet API. The simplest way to access information from a document's stylesheets is using the styleSheets property of the current document. This exposes the CSSStyleSheet interface.
For example, the line below uses the length property to see how many stylesheets the current document has:
document.styleSheets.length; // 1
I can reference any of the document's stylesheets using zero-based indexing:
document.styleSheets[0];
If I log that stylesheet to my console, I can view the methods and properties available:
Tumblr media
The one that will prove useful is the cssRules property. This property provides a list of all CSS rules (including declaration blocks, at-rules, media rules, etc.) contained in that stylesheet. In the following sections, I'll detail how to utilize this API to manipulate and read styles from an external stylesheet.
Working with a Stylesheet Object
For the purpose of simplicity, let's work with a sample stylesheet that has only a handful of rules in it. This will allow me to demonstrate how to use the CSSOM to access the different parts of a stylesheet in a similar way to accessing elements via DOM scripting.
Here is the stylesheet I'll be working with:
* { box-sizing: border-box; } body { font-family: Helvetica, Arial, sans-serif; font-size: 2em; line-height: 1.4; } main { width: 1024px; margin: 0 auto !important; } .component { float: right; border-left: solid 1px #444; margin-left: 20px; } @media (max-width: 800px) { body { line-height: 1.2; } .component { float: none; margin: 0; } } a:hover { color: lightgreen; } @keyframes exampleAnimation { from { color: blue; } 20% { color: orange; } to { color: green; } } code { color: firebrick; }
There's a number of different things I can attempt with this example stylesheet and I'll demonstrate a few of those here. First, I'm going to loop through all the style rules in the stylesheet and log the selector text for each one:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('p'); for (i of myRules) { if (i.type === 1) { p.innerHTML += `<c​ode>${i.selectorText}</c​ode><br>`; } }
See the Pen Working with CSSStyleSheet - Logging the Selector Text by Louis Lazaris (@impressivewebs) on CodePen.
A couple of things to take note of in the above code and demo. First, I cache a reference to the cssRules object for my stylesheet. Then I loop over all the rules in that object, checking to see what type each one is.
In this case, I want rules that are type 1, which represents the STYLE_RULE constant. Other constants include IMPORT_RULE (3), MEDIA_RULE (4), KEYFRAMES_RULE (7), etc. You can view a full table of these constants in this MDN article.
When I confirm that a rule is a style rule, I print the selectorText property for each of those style rules. This will produce the following lines for the specified stylesheet:
* body main .component a:hover code
The selectorText property is a string representation of the selector used on that rule. This is a writable property, so if I want I can change the selector for a specific rule inside my original for loop with the following code:
if (i.selectorText === 'a:hover') { i.selectorText = 'a:hover, a:active'; }
See the Pen Working with the CSSStyleSheet API – Changing the Selector Text by Louis Lazaris (@impressivewebs) on CodePen.
In this example, I'm looking for a selector that defines :hover styles on my links and expanding the selector to apply the same styles to elements in the :active state. Alternatively, I could use some kind of string method or even a regular expression to look for all instances of :hover, and then do something from there. But this should be enough to demonstrate how it works.
Accessing @media Rules with the CSSOM
You'll notice my stylesheet also includes a media query rule and a keyframes at-rule block. Both of those were skipped when I searched for style rules (type 1). Let's now find all @media rules:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('.output'); for (i of myRules) { if (i.type === 4) { for (j of i.cssRules) { p.innerHTML += `<c​ode>${j.selectorText}</c​ode><br>`; } } }
Based on the given stylesheet, the above will produce:
body .component
See the Pen Working with the CSSStyleSheet API – Accessing @media Rules by Louis Lazaris (@impressivewebs) on CodePen.
As you can see, after I loop through all the rules to see if any @media rules exist (type 4), I then loop through the cssRules object for each media rule (in this case, there's only one) and log the selector text for each rule inside that media rule.
So the interface that's exposed on a @media rule is similar to the interface exposed on a stylesheet. The @media rule, however, also includes a conditionText property, as shown in the following snippet and demo:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('.output'); for (i of myRules) { if (i.type === 4) { p.innerHTML += `<c​ode>${i.conditionText}</c​ode><br>`; // (max-width: 800px) } }
See the Pen Working with the CSSStyleSheet API – Accessing @media Rules by Louis Lazaris (@impressivewebs) on CodePen.
This code loops through all media query rules and logs the text that determines when that rule is applicable (i.e. the condition). There's also a mediaText property that returns the same value. According to the spec, you can get or set either of these.
Accessing @keyframes Rules with the CSSOM
Now that I've demonstrated how to read information from a @media rule, let's consider how to access a @keyframes rule. Here's some code to get started:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('.output'); for (i of myRules) { if (i.type === 7) { for (j of i.cssRules) { p.innerHTML += `<c​ode>${j.keyText}</c​ode><br>`; } } }
See the Pen Working with the CSSStyleSheet API – Accessing @keyframes Rules by Louis Lazaris (@impressivewebs) on CodePen.
In this example, I'm looking for rules that have a type of 7 (i.e. @keyframes rules). When one is found, I loop through all of that rule's cssRules and log the keyText property for each. The log in this case will be:
"0%" "20%" "100%"
You'll notice my original CSS uses from and to as the first and last keyframes, but the keyText property computes these to 0% and 100%. The value of keyText can also be set. In my example stylesheet, I could hard code it like this:
// Read the current value (0%) document.styleSheets[0].cssRules[6].cssRules[0].keyText; // Change the value to 10% document.styleSheets[0].cssRules[6].cssRules[0].keyText = '10%' // Read the new value (10%) document.styleSheets[0].cssRules[6].cssRules[0].keyText;
See the Pen Working with the CSSStyleSheet API – Setting @keyframes Rules by Louis Lazaris (@impressivewebs) on CodePen.
Using this, we can dynamically alter an animation's keyframes in the flow of a web app or possibly in response to a user action.
Another property available when accessing a @keyframes rule is name:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('.output'); for (i of myRules) { if (i.type === 7) { p.innerHTML += `<c​ode>${i.name}</c​ode><br>`; } }
See the Pen Working with the CSSStyleSheet API – Getting the name of a @keyframes rule by Louis Lazaris (@impressivewebs) on CodePen.
Recall that in the CSS, the @keyframes rule looks like this:
@keyframes exampleAnimation { from { color: blue; } 20% { color: orange; } to { color: green; } }
Thus, the name property allows me to read the custom name chosen for that @keyframes rule. This is the same name that would be used in the animation-name property when enabling the animation on a specific element.
One final thing I'll mention here is the ability to grab specific styles that are inside a single keyframe. Here's some example code with a demo:
let myRules = document.styleSheets[0].cssRules, p = document.querySelector('.output'); for (i of myRules) { if (i.type === 7) { for (j of i.cssRules) { p.innerHTML += `<c​ode>${j.style.color}</c​ode><br>`; } } }
See the Pen Working with the CSSStyleSheet API – Accessing Property Values inside @keyframes Rules by Louis Lazaris (@impressivewebs) on CodePen.
In this example, after I find the @keyframes rule, I loop through each of the rules in the keyframe (e.g. the "from" rule, the "20%" rule, etc). Then, within each of those rules, I access an individual style property. In this case, since I know color is the only property defined for each, I'm merely logging out the color values.
The main takeaway in this instance is the use of the style property, or object. Earlier I showed how this property can be used to access inline styles. But in this case, I'm using it to access the individual properties inside of a single keyframe.
You can probably see how this opens up some possibilities. This allows you to modify an individual keyframe's properties on the fly, which could happen as a result of some user action or something else taking place in an app or possibly a web-based game.
Adding and Removing CSS Declarations
The CSSStyleSheet interface has access to two methods that allow you to add or remove an entire rule from a stylesheet. The methods are: insertRule() and deleteRule(). Let's see both of them in action manipulating our example stylesheet:
let myStylesheet = document.styleSheets[0]; console.log(myStylesheet.cssRules.length); // 8 document.styleSheets[0].insertRule('article { line-height: 1.5; font-size: 1.5em; }', myStylesheet.cssRules.length); console.log(document.styleSheets[0].cssRules.length); // 9
See the Pen Working with the CSSStyleSheet API – Inserting Rules by Louis Lazaris (@impressivewebs) on CodePen.
In this case, I'm logging the length of the cssRules property (showing that the stylesheet originally has 8 rules in it), then I add the following CSS as an individual rule using the insertRule() method:
article { line-height: 1.5; font-size: 1.5em; }
I log the length of the cssRules property again to confirm that the rule was added.
The insertRule() method takes a string as the first parameter (which is mandatory), comprising the full style rule that you want to insert (including selector, curly braces, etc). If you're inserting an at-rule, then the full at-rule, including the individual rules nested inside the at-rule can be included in this string.
The second argument is optional. This is an integer that represents the position, or index, where you want the rule inserted. If this isn't included, it defaults to 0 (meaning the rule will be inserted at the beginning of the rules collection). If the index happens to be larger than the length of the rules object, it will throw an error.
The deleteRule() method is much simpler to use:
let myStylesheet = document.styleSheets[0]; console.log(myStylesheet.cssRules.length); // 8 myStylesheet.deleteRule(3); console.log(myStylesheet.cssRules.length); // 7
See the Pen Working with the CSSStyleSheet API – Deleting Rules by Louis Lazaris (@impressivewebs) on CodePen.
In this case, the method accepts a single argument that represents the index of the rule I want to remove.
With either method, because of zero-based indexing, the selected index passed in as an argument has to be less than the length of the cssRules object, otherwise it will throw an error.
Revisiting the CSSStyleDeclaration API
Earlier I explained how to access individual properties and values declared as inline styles. This was done via element.style, exposing the CSSStyleDeclaration interface.
The CSSStyleDeclaration API, however, can also be exposed on an individual style rule as a subset of the CSSStyleSheet API. I already alluded to this when I showed you how to access properties inside a @keyframes rule. To understand how this works, compare the following two code snippets:
<div style="color: lightblue; width: 100px; font-size: 1.3em !important;"></div>
.box { color: lightblue; width: 100px; font-size: 1.3em !important; }
The first example is a set of inline styles that can be accessed as follows:
document.querySelector('div').style
This exposes the CSSStyleDeclaration API, which is what allows me to do stuff like element.style.color, element.style.width, etc.
But I can expose the exact same API on an individual style rule in an external stylesheet. This means I'm combining my use of the style property with the CSSStyleSheet interface.
So the CSS in the second example above, which uses the exact same styles as the inline version, can be accessed like this:
document.styleSheets[0].cssRules[0].style
This opens up a single CSSStyleDeclaration object on the one style rule in the stylesheet. If there were multiple style rules, each could be accessed using cssRules[1], cssRules[2], cssRules[3], and so on.
So within an external stylesheet, inside of a single style rule that is of type 1, I have access to all the methods and properties mentioned earlier. This includes setProperty(), getPropertyValue(), item(), removeProperty(), and getPropertyPriority(). In addition to this, those same features are available on an individual style rule inside of a @keyframes or @media rule.
Here's a code snippet and demo that demonstrates how these methods would be used on an individual style rule in our sample stylesheet:
// Grab the style rules for the body and main elements let myBodyRule = document.styleSheets[0].cssRules[1].style, myMainRule = document.styleSheets[0].cssRules[2].style; // Set the bg color on the body myBodyRule.setProperty('background-color', 'peachpuff'); // Get the font size of the body myBodyRule.getPropertyValue('font-size'); // Get the 5th item in the body's style rule myBodyRule.item(5); // Log the current length of the body style rule (8) myBodyRule.length; // Remove the line height myBodyRule.removeProperty('line-height'); // log the length again (7) myBodyRule.length; // Check priority of font-family (empty string) myBodyRule.getPropertyPriority('font-family'); // Check priority of margin in the "main" style rule (!important) myMainRule.getPropertyPriority('margin');
See the Pen Working with the style object of an individual style rule in an external Stylesheet by Louis Lazaris (@impressivewebs) on CodePen.
The CSS Typed Object Model... The Future?
After everything I've considered in this article, it would seem odd that I'd have to break the news that it's possible that one day the CSSOM as we know it will be mostly obsolete.
That's because of something called the CSS Typed OM which is part of the Houdini Project. Although some people have noted that the new Typed OM is more verbose compared to the current CSSOM, the benefits, as outlined in this article by Eric Bidelman, include:
Fewer bugs
Arithmetic operations and unit conversion
Better performance
Error handling
CSS property names are always strings
For full details on those features and a glimpse into the syntax, be sure to check out the full article.
As of this writing, CSS Typed OM is supported only in Chrome. You can see the progress of browser support in this document.
Final Words
Manipulating stylesheets via JavaScript certainly isn't something you're going to do in every project. And some of the complex interactions made possible with the methods and properties I've introduced here have some very specific use cases.
If you've built some kind of tool that uses any of these APIs I'd love to hear about it. My research has only scratched the surface of what's possible, but I'd love to see how any of this can be used in real-world examples.
I've put all the demos from this article into a CodePen collection, so you can feel free to mess around with those as you like.
The post An Introduction and Guide to the CSS Object Model (CSSOM) appeared first on CSS-Tricks.
An Introduction and Guide to the CSS Object Model (CSSOM) published first on https://deskbysnafu.tumblr.com/
0 notes
raspberryconverse · 2 years ago
Note
Just bought a house 11 months ago with my spouse and we closed 1 week before our wedding (100% do NOT recommend, BTW).
I know in the IBLP they try not to get into debt so this is probably not applicable, but when you apply for a mortgage with someone, it's important to see if you can qualify for a better rate if someone buys solo vs buying jointly. If my spouse could have afforded the house on their own, we would have had them take out the mortgage in their name only because they have excellent credit. Unfortunately, they don't make enough money to afford the mortgage on their own, so we needed to apply jointly. My credit is fair-good, so we unfortunately ended up with a higher interest rate because we needed both incomes to qualify for the loan.
This also could be completely irrelevant even if he did apply for a mortgage, considering Kaylee (almost certainly) doesn't have a credit history, so her being on the loan would probably be moot. And of course you don't have to be on the both the mortgage AND the deed. You're allowed to add someone to the deed, whether they purchased the house with you or not. He also might have wanted to wait until Kaylee did all the paperwork to change her last name to put her on there. I know our deed and mortgage both have my maiden name and there was no way to have it otherwise because we didn't a copy of the marriage certificate because we weren't married yet. And you have to take that to Social Security to get a new SS card and then take that to the DMV to get a new drivers license/ID, so it's a whole ordeal you literally cannot do until after you're married because you have to submit your signed marriage license to the state and then receive your marriage certificate (which takes at least a week). Lucky for me, I hyphenated, so it's a little less difficult to deduce that it's the same person (and I've been too lazy to update all my credit cards/banking stuff anyway, lol).
So I can think of a couple reasons why Kaylee is not on the deed yet. Might not be fundie related, might just be name change related. Or even both: "If it says 'Jonathon Hill and Kaylee Rodrigues' on the deed, it will make people think we lived together before we got married and that would be a sin."
Ok I had to do some digging on my local county tax assessors site for personal reasons, went down a rabbit hole, and long story short, Kaylee Rodrigues’s name isn’t on her and Jonathan Hill’s house. He bought it right before the wedding, do you think he’ll add her to it later? I don’t know much about homeownership but all the other fundies I looked up (exception brittany dawn who was single when she bought her house) had both people listed on the purchase. It seems weird to me?? They were less than a month out from being married
I don’t know much about houses or how owning one even really works but, I’d assume from what I know about fundies that it might be that Kaylee is going to be a 100% Stay at home wife/mom and they don’t want her to be potentially responsible for payments? Or Jonathan did it that way to “prove” he alone can provide for Kaylee and future kids. It could also just boil down to another form of control fundie husbands have over their wives.
8 notes · View notes